diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/action_type_support_decl.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/action_type_support_decl.hpp index 193567855..11c8d98d7 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/action_type_support_decl.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/action_type_support_decl.hpp @@ -27,6 +27,7 @@ namespace rosidl_runtime_cpp * \return Function handler for the action's typesupport. */ template +[[nodiscard]] const rosidl_action_type_support_t * get_action_type_support_handle(); } // namespace rosidl_runtime_cpp diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/bounded_vector.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/bounded_vector.hpp index f2fa3c0b5..cad016f1b 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/bounded_vector.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/bounded_vector.hpp @@ -714,6 +714,7 @@ class BoundedVector * \param y A %BoundedVector of the same type as @a x * \return True if the size and elements of the vectors are equal */ + [[nodiscard]] friend bool operator==( const BoundedVector & x, @@ -734,6 +735,7 @@ class BoundedVector * \param y A %BoundedVector of the same type as @a x * @return True if @a x is lexicographically less than @a y */ + [[nodiscard]] friend bool operator<( const BoundedVector & x, @@ -743,6 +745,7 @@ class BoundedVector } /// Based on operator== + [[nodiscard]] friend bool operator!=( const BoundedVector & x, @@ -752,6 +755,7 @@ class BoundedVector } /// Based on operator< + [[nodiscard]] friend bool operator>( const BoundedVector & x, @@ -761,6 +765,7 @@ class BoundedVector } /// Based on operator< + [[nodiscard]] friend bool operator<=( const BoundedVector & x, @@ -770,6 +775,7 @@ class BoundedVector } /// Based on operator< + [[nodiscard]] friend bool operator>=( const BoundedVector & x, diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/message_type_support_decl.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/message_type_support_decl.hpp index 69cf8de39..c6c9e4735 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/message_type_support_decl.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/message_type_support_decl.hpp @@ -27,6 +27,7 @@ namespace rosidl_runtime_cpp * \return Function handler for the message's typesupport. */ template +[[nodiscard]] const rosidl_message_type_support_t * get_message_type_support_handle(); } // namespace rosidl_runtime_cpp diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/service_type_support_decl.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/service_type_support_decl.hpp index 80eeb79fd..0f024bb6c 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/service_type_support_decl.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/service_type_support_decl.hpp @@ -27,6 +27,7 @@ namespace rosidl_runtime_cpp * \return Function handler for the service's typesupport. */ template +[[nodiscard]] const rosidl_service_type_support_t * get_service_type_support_handle(); } // namespace rosidl_runtime_cpp diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/field__struct.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/field__struct.hpp index 210af6b71..9e51a7792 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/field__struct.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/field__struct.hpp @@ -133,6 +133,7 @@ struct Field_ ConstPtr; // comparison operators + [[nodiscard]] bool operator==(const Field_ & other) const { if (this->name != other.name) { @@ -146,6 +147,7 @@ struct Field_ } return true; } + [[nodiscard]] bool operator!=(const Field_ & other) const { return !this->operator==(other); diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/field_type__struct.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/field_type__struct.hpp index 63cb2a55c..d22b67522 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/field_type__struct.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/field_type__struct.hpp @@ -335,6 +335,7 @@ struct FieldType_ ConstPtr; // comparison operators + [[nodiscard]] bool operator==(const FieldType_ & other) const { if (this->type_id != other.type_id) { @@ -351,6 +352,7 @@ struct FieldType_ } return true; } + [[nodiscard]] bool operator!=(const FieldType_ & other) const { return !this->operator==(other); diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/individual_type_description__struct.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/individual_type_description__struct.hpp index 890a396b9..2eb491aee 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/individual_type_description__struct.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/individual_type_description__struct.hpp @@ -119,6 +119,7 @@ struct IndividualTypeDescription_ ConstPtr; // comparison operators + [[nodiscard]] bool operator==(const IndividualTypeDescription_ & other) const { if (this->type_name != other.type_name) { @@ -129,6 +130,7 @@ struct IndividualTypeDescription_ } return true; } + [[nodiscard]] bool operator!=(const IndividualTypeDescription_ & other) const { return !this->operator==(other); diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/key_value__struct.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/key_value__struct.hpp index 7cd25f6c1..86e95c2ca 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/key_value__struct.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/key_value__struct.hpp @@ -118,6 +118,7 @@ struct KeyValue_ ConstPtr; // comparison operators + [[nodiscard]] bool operator==(const KeyValue_ & other) const { if (this->key != other.key) { @@ -128,6 +129,7 @@ struct KeyValue_ } return true; } + [[nodiscard]] bool operator!=(const KeyValue_ & other) const { return !this->operator==(other); diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/type_description__struct.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/type_description__struct.hpp index a56949cd2..8c74cbc77 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/type_description__struct.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/type_description__struct.hpp @@ -113,6 +113,7 @@ struct TypeDescription_ ConstPtr; // comparison operators + [[nodiscard]] bool operator==(const TypeDescription_ & other) const { if (this->type_description != other.type_description) { @@ -123,6 +124,7 @@ struct TypeDescription_ } return true; } + [[nodiscard]] bool operator!=(const TypeDescription_ & other) const { return !this->operator==(other); diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/type_source__struct.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/type_source__struct.hpp index 7ee8385e8..9c3cb7924 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/type_source__struct.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/type_description/type_source__struct.hpp @@ -130,6 +130,7 @@ struct TypeSource_ ConstPtr; // comparison operators + [[nodiscard]] bool operator==(const TypeSource_ & other) const { if (this->type_name != other.type_name) { @@ -143,6 +144,7 @@ struct TypeSource_ } return true; } + [[nodiscard]] bool operator!=(const TypeSource_ & other) const { return !this->operator==(other); diff --git a/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/action_type_support.hpp b/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/action_type_support.hpp index e0befe2bc..2d0171a73 100644 --- a/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/action_type_support.hpp +++ b/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/action_type_support.hpp @@ -22,6 +22,7 @@ namespace rosidl_typesupport_cpp { template +[[nodiscard]] const rosidl_action_type_support_t * get_action_type_support_handle(); } // namespace rosidl_typesupport_cpp diff --git a/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/message_type_support.hpp b/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/message_type_support.hpp index 6fad1d7d5..af0064efd 100644 --- a/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/message_type_support.hpp +++ b/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/message_type_support.hpp @@ -22,6 +22,7 @@ namespace rosidl_typesupport_cpp { template +[[nodiscard]] const rosidl_message_type_support_t * get_message_type_support_handle(); } // namespace rosidl_typesupport_cpp diff --git a/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/service_type_support.hpp b/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/service_type_support.hpp index 2931b8736..23b3e8a45 100644 --- a/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/service_type_support.hpp +++ b/rosidl_runtime_cpp/include/rosidl_typesupport_cpp/service_type_support.hpp @@ -25,6 +25,7 @@ namespace rosidl_typesupport_cpp { template +[[nodiscard]] const rosidl_service_type_support_t * get_service_type_support_handle(); template diff --git a/rosidl_typesupport_introspection_cpp/include/rosidl_typesupport_introspection_cpp/message_type_support_decl.hpp b/rosidl_typesupport_introspection_cpp/include/rosidl_typesupport_introspection_cpp/message_type_support_decl.hpp index 97eece341..3666c49dd 100644 --- a/rosidl_typesupport_introspection_cpp/include/rosidl_typesupport_introspection_cpp/message_type_support_decl.hpp +++ b/rosidl_typesupport_introspection_cpp/include/rosidl_typesupport_introspection_cpp/message_type_support_decl.hpp @@ -28,6 +28,7 @@ namespace rosidl_typesupport_introspection_cpp /// the rosidl_generate_interfaces() macro. /// This is implemented in the shared library provided by this package. template +[[nodiscard]] ROSIDL_TYPESUPPORT_INTROSPECTION_CPP_PUBLIC const rosidl_message_type_support_t * get_message_type_support_handle(); diff --git a/rosidl_typesupport_introspection_cpp/include/rosidl_typesupport_introspection_cpp/service_type_support_decl.hpp b/rosidl_typesupport_introspection_cpp/include/rosidl_typesupport_introspection_cpp/service_type_support_decl.hpp index eaa3db906..bcc6ac858 100644 --- a/rosidl_typesupport_introspection_cpp/include/rosidl_typesupport_introspection_cpp/service_type_support_decl.hpp +++ b/rosidl_typesupport_introspection_cpp/include/rosidl_typesupport_introspection_cpp/service_type_support_decl.hpp @@ -27,6 +27,7 @@ namespace rosidl_typesupport_introspection_cpp /// services. /// This is implemented in the shared library provided by this package. template +[[nodiscard]] ROSIDL_TYPESUPPORT_INTROSPECTION_CPP_PUBLIC const rosidl_service_type_support_t * get_service_type_support_handle();