[#mp_units-utility-operator_eq-0a]
= xref:mp_units.adoc[mp&lowbar;units]::xref:mp_units/utility.adoc[utility]::operator&equals;&equals;
:relfileprefix: ../../
:mrdocs:

Equality operators

== Synopses

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

Checks whether a safe&lowbar;int and a constrained value are equal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
bool
xref:mp_units/utility/operator_eq-07.adoc[operator&equals;&equals;](
    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_eq-07.adoc[_» more&period;&period;&period;_]#

Checks whether a `safe&lowbar;int` equals a floating&hyphen;point value&period;


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

[.small]#xref:mp_units/utility/operator_eq-0e.adoc[_» more&period;&period;&period;_]#

Checks whether a `safe&lowbar;int` equals an integral scalar, comparing safely across signedness&period;


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

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

Checks whether two `safe&lowbar;int` values wrap equal underlying values&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
bool
xref:mp_units/utility/operator_eq-0b.adoc[operator&equals;&equals;](
    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_eq-0b.adoc[_» more&period;&period;&period;_]#

== Return Value

* `true` if the underlying values are equal
* `true` if the wrapped value equals `rhs`
* `true` if the wrapped values are equal

[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]#
