mp_units::operator==

Equality operators

Synopses

Declared in <mp-units/framework/quantity_character.h>

Compares two quantity characters lexicographically on (order, field)

[[nodiscard]]
constexpr
bool
operator==(
    quantity_character lhs,
    quantity_character rhs) = default;
» more...

Checks whether a reference is equal to a unit

[[nodiscard]]
consteval
bool
operator==(
    reference r,
    U2 u2);
» more...

Checks whether two references are equal

[[nodiscard]]
consteval
bool
operator==(
    reference r1,
    reference<Q2, U2> r2);
» more...

Return Value

  • the lexicographic ordering of lhs and rhs
  • true if the reference'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 should not be discarded.

Parameters

NameDescription
lhsfirst quantity character to compare
rhssecond quantity character to compare
rthe reference to compare
u2the unit to compare against
r1the first reference to compare
r2the other reference to compare against