Equality operators
Synopses
Declared in <mp‐units/utility/safe_int.h>
Checks whether a safe_int and a constrained value are equal
[[nodiscard]]
constexpr
bool
operator==(
safe_int lhs,
constrained<U, CP> const& rhs);
Checks whether a safe_int equals a floating‐point value.
[[nodiscard]]
constexpr
bool
operator==(
safe_int lhs,
U rhs);
Checks whether a safe_int equals an integral scalar, comparing safely across signedness.
[[nodiscard]]
constexpr
bool
operator==(
safe_int lhs,
U rhs);
Checks whether two safe_int values wrap equal underlying values.
[[nodiscard]]
constexpr
bool
operator==(
safe_int lhs,
safe_int rhs) noexcept;
Return Value
-
trueif the underlying values are equal -
trueif the wrapped value equalsrhs -
trueif the wrapped values are equal
|
Note
|
The return value should not be discarded. |
Template Parameters
Name |
Description |
U |
a floating‐point‐like type ( |
Parameters
Name |
Description |
lhs |
the safe_int to compare |
rhs |
the constrained value to compare against |
Created with MrDocs