Template Function rclcpp::add_will_overflow
Defined in File utilities.hpp
Function Documentation
-
template<typename T>
bool rclcpp::add_will_overflow(const T x, const T y) Safely check if addition will overflow.
The type of the operands, T, should have defined std::numeric_limits<T>::max(),
>
,<
and-
operators.- Parameters:
x – [in] is the first addend.
y – [in] is the second addend.
- Template Parameters:
T – is type of the operands.
- Returns:
True if the x + y sum is greater than T::max value.