[#mp_units-utility-operator_3way-029]
= xref:mp_units.adoc[mp&lowbar;units]::xref:mp_units/utility.adoc[utility]::operator&lt;&equals;&gt;
:relfileprefix: ../../
:mrdocs:

Three&hyphen;way comparison operators

== Synopses

Declared in `&lt;mp&hyphen;units&sol;utility&sol;safe&lowbar;int&period;h&gt;`

Compares a safe&lowbar;int with a constrained value


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
auto
xref:mp_units/utility/operator_3way-09a.adoc[operator&lt;&equals;&gt;](
    xref:mp_units/utility/safe_int-07.adoc[safe&lowbar;int] lhs,
    xref:mp_units/utility/constrained.adoc[constrained&lt;U, CP&gt;] const& rhs);
----

[.small]#xref:mp_units/utility/operator_3way-09a.adoc[_» more&period;&period;&period;_]#

Compares a `safe&lowbar;int` with a floating&hyphen;point value&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
auto
xref:mp_units/utility/operator_3way-021.adoc[operator&lt;&equals;&gt;](
    xref:mp_units/utility/safe_int-07.adoc[safe&lowbar;int] lhs,
    U rhs);
----

[.small]#xref:mp_units/utility/operator_3way-021.adoc[_» more&period;&period;&period;_]#

Compares a `safe&lowbar;int` with an integral scalar, comparing safely across signedness&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
std::strong&lowbar;ordering
xref:mp_units/utility/operator_3way-097.adoc[operator&lt;&equals;&gt;](
    xref:mp_units/utility/safe_int-07.adoc[safe&lowbar;int] lhs,
    U rhs);
----

[.small]#xref:mp_units/utility/operator_3way-097.adoc[_» more&period;&period;&period;_]#

Compares two `safe&lowbar;int` values by their wrapped underlying values&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
std::strong&lowbar;ordering
xref:mp_units/utility/operator_3way-06.adoc[operator&lt;&equals;&gt;](
    xref:mp_units/utility/safe_int-07.adoc[safe&lowbar;int] lhs,
    xref:mp_units/utility/safe_int-07.adoc[safe&lowbar;int] rhs) noexcept;
----

[.small]#xref:mp_units/utility/operator_3way-06.adoc[_» more&period;&period;&period;_]#

== 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&hyphen;point&hyphen;like type (`treat&lowbar;as&lowbar;floating&lowbar;point&lt;U&gt;` is `true`)
|===

== Parameters

[cols="1,4"]
|===
| Name| Description
| *lhs*
| the safe&lowbar;int to compare
| *rhs*
| the constrained value to compare against
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
