Getters and operators could have the [[nodiscard]] attribute to prevent bugs.
Implementation considerations
See /opt/ros/humble/include/geometry_msgs/geometry_msgs/msg/detail/point__struct.hpp. This is ABI breaking because it increases the strictness of the API.
Feature request
Feature description
Getters and operators could have the [[nodiscard]] attribute to prevent bugs.
Implementation considerations
See
/opt/ros/humble/include/geometry_msgs/geometry_msgs/msg/detail/point__struct.hpp
. This is ABI breaking because it increases the strictness of the API.Before:
Proposed:
Effect:
Using the
!=
operator without assigning the value would then issue a compile warning.Related
Same as https://github.com/gazebosim/sdformat/issues/1358