Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global use of nodiscard #801

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace rosidl_runtime_cpp
* \return Function handler for the action's typesupport.
*/
template<typename T>
[[nodiscard]]
const rosidl_action_type_support_t * get_action_type_support_handle();

} // namespace rosidl_runtime_cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -743,6 +745,7 @@ class BoundedVector
}

/// Based on operator==
[[nodiscard]]
friend bool
operator!=(
const BoundedVector & x,
Expand All @@ -752,6 +755,7 @@ class BoundedVector
}

/// Based on operator<
[[nodiscard]]
friend bool
operator>(
const BoundedVector & x,
Expand All @@ -761,6 +765,7 @@ class BoundedVector
}

/// Based on operator<
[[nodiscard]]
friend bool
operator<=(
const BoundedVector & x,
Expand All @@ -770,6 +775,7 @@ class BoundedVector
}

/// Based on operator<
[[nodiscard]]
friend bool
operator>=(
const BoundedVector & x,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace rosidl_runtime_cpp
* \return Function handler for the message's typesupport.
*/
template<typename T>
[[nodiscard]]
const rosidl_message_type_support_t * get_message_type_support_handle();

} // namespace rosidl_runtime_cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace rosidl_runtime_cpp
* \return Function handler for the service's typesupport.
*/
template<typename T>
[[nodiscard]]
const rosidl_service_type_support_t * get_service_type_support_handle();

} // namespace rosidl_runtime_cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace rosidl_typesupport_cpp
{

template<typename T>
[[nodiscard]]
const rosidl_action_type_support_t * get_action_type_support_handle();

} // namespace rosidl_typesupport_cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace rosidl_typesupport_cpp
{

template<typename T>
[[nodiscard]]
const rosidl_message_type_support_t * get_message_type_support_handle();

} // namespace rosidl_typesupport_cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace rosidl_typesupport_cpp
{

template<typename T>
[[nodiscard]]
const rosidl_service_type_support_t * get_service_type_support_handle();

template<typename T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename T>
[[nodiscard]]
ROSIDL_TYPESUPPORT_INTROSPECTION_CPP_PUBLIC
const rosidl_message_type_support_t * get_message_type_support_handle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace rosidl_typesupport_introspection_cpp
/// services.
/// This is implemented in the shared library provided by this package.
template<typename T>
[[nodiscard]]
ROSIDL_TYPESUPPORT_INTROSPECTION_CPP_PUBLIC
const rosidl_service_type_support_t * get_service_type_support_handle();

Expand Down
Loading