Three-way comparison operators
Declared in <mp-units/utility/safe_int.h>
Compares a safe_int with a constrained value
[[nodiscard]]
constexpr
auto
operator<=>(
safe_int lhs,
constrained<U, CP> const& rhs);
» more...
Compares a safe_int with a floating-point value.
[[nodiscard]]
constexpr
auto
operator<=>(
safe_int lhs,
U rhs);
» more...
Compares a safe_int with an integral scalar, comparing safely across signedness.
[[nodiscard]]
constexpr
std::strong_ordering
operator<=>(
safe_int lhs,
U rhs);
» more...
Compares two safe_int values by their wrapped underlying values.
[[nodiscard]]
constexpr
std::strong_ordering
operator<=>(
safe_int lhs,
safe_int rhs) noexcept;
» more...
rhsThe return value should not be discarded.
| Name | Description |
|---|---|
| U | a floating-point-like type (treat_as_floating_point<U> is true) |
| Name | Description |
|---|---|
| lhs | the safe_int to compare |
| rhs | the constrained value to compare against |