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

Equality operators

== Synopses

Declared in `&lt;mp&hyphen;units&sol;framework&sol;quantity&lowbar;character&period;h&gt;`

Compares two quantity characters lexicographically on (order, field)


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
bool
operator&equals;&equals;(
    xref:mp_units/quantity_character.adoc[quantity&lowbar;character] lhs,
    xref:mp_units/quantity_character.adoc[quantity&lowbar;character] rhs) = default;
----

[.small]#[_» more&period;&period;&period;_]#

Checks whether a reference is equal to a unit


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
bool
xref:mp_units/operator_eq-02.adoc[operator&equals;&equals;](
    xref:mp_units/reference-0b2.adoc[reference] r,
    U2 u2);
----

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

Checks whether two references are equal


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
bool
xref:mp_units/operator_eq-07.adoc[operator&equals;&equals;](
    xref:mp_units/reference-0b2.adoc[reference] r1,
    xref:mp_units/reference-0b2.adoc[reference&lt;Q2, U2&gt;] r2);
----

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

== Return Value

* the lexicographic ordering of `lhs` and `rhs`
* `true` if the reference&apos;s quantity specification and unit match those implied by `u2`
* `true` if both the quantity specifications and the units are equal

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *lhs*
| first quantity character to compare
| *rhs*
| second quantity character to compare
| *r*
| the reference to compare
| *u2*
| the unit to compare against
| *r1*
| the first reference to compare
| *r2*
| the other reference to compare against
|===


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