[#mp_units-utility-operator_3way-029] = xref:mp_units.adoc[mp_units]::xref:mp_units/utility.adoc[utility]::operator<=> :relfileprefix: ../../ :mrdocs: Three‐way comparison operators == Synopses Declared in `<mp‐units/utility/safe_int.h>` Compares a safe_int with a constrained value [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr auto xref:mp_units/utility/operator_3way-09a.adoc[operator<=>]( xref:mp_units/utility/safe_int-07.adoc[safe_int] lhs, xref:mp_units/utility/constrained.adoc[constrained<U, CP>] const& rhs); ---- [.small]#xref:mp_units/utility/operator_3way-09a.adoc[_» more..._]# Compares a `safe_int` with a floating‐point value. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr auto xref:mp_units/utility/operator_3way-021.adoc[operator<=>]( xref:mp_units/utility/safe_int-07.adoc[safe_int] lhs, U rhs); ---- [.small]#xref:mp_units/utility/operator_3way-021.adoc[_» more..._]# Compares a `safe_int` with an integral scalar, comparing safely across signedness. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr std::strong_ordering xref:mp_units/utility/operator_3way-097.adoc[operator<=>]( xref:mp_units/utility/safe_int-07.adoc[safe_int] lhs, U rhs); ---- [.small]#xref:mp_units/utility/operator_3way-097.adoc[_» more..._]# Compares two `safe_int` values by their wrapped underlying values. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr std::strong_ordering xref:mp_units/utility/operator_3way-06.adoc[operator<=>]( xref:mp_units/utility/safe_int-07.adoc[safe_int] lhs, xref:mp_units/utility/safe_int-07.adoc[safe_int] rhs) noexcept; ---- [.small]#xref:mp_units/utility/operator_3way-06.adoc[_» more..._]# == Return Value * the ordering of the underlying values * the ordering between the wrapped value and `rhs` * the ordering of the wrapped values [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Template Parameters [cols="1,4"] |=== | Name| Description | *U* | a floating‐point‐like type (`treat_as_floating_point<U>` is `true`) |=== == Parameters [cols="1,4"] |=== | Name| Description | *lhs* | the safe_int to compare | *rhs* | the constrained value to compare against |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#