Equality operators

Synopses

Declared in <mp‐units/ext/fixed_string.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

template<Unit U2>
[[nodiscard]]
consteval
bool
operator==(
    reference r,
    U2 u2);

Checks whether two references are equal

template<
    typename Q2,
    typename U2>
[[nodiscard]]
consteval
bool
operator==(
    reference r1,
    reference<Q2, U2> r2);

Equality operator

template<
    typename CharT,
    std::size_t N,
    std::size_t N2>
[[nodiscard]]
consteval
bool
operator==(
    basic_fixed_string<CharT, N> const& lhs,
    CharT const(& rhs)[]);

Equality operator

template<
    typename CharT,
    std::size_t N,
    std::size_t N2>
[[nodiscard]]
constexpr
bool
operator==(
    basic_fixed_string<CharT, N> const& lhs,
    basic_fixed_string<CharT, N2> const& rhs);

Equality operator

template<
    Dimension Lhs,
    Dimension Rhs>
[[nodiscard]]
consteval
bool
operator==(
    Lhs lhs,
    Rhs rhs);

Equality operator

template<
    Dimension Lhs,
    Dimension Rhs>
[[nodiscard]]
consteval
bool
operator==(
    Lhs lhs,
    Rhs rhs);

Equality operator

template<
    Dimension Lhs,
    Dimension Rhs>
[[nodiscard]]
consteval
bool
operator==(
    Lhs lhs,
    Rhs rhs);

Equality operator

template<
    auto R1,
    typename Rep1,
    RepresentationOf<get_quantity_spec(R1)> Value>
requires ImplicitFromNumber<R1> && std::equality_comparable_with<Rep1, Value>
[[nodiscard]]
constexpr
bool
operator==(
    quantity<R1, Rep1> const& lhs,
    Value const& rhs);

Equality operator

template<
    auto R1,
    typename Rep1,
    auto R2,
    typename Rep2>
requires CommonlyComparableQuantities<quantity<R1, Rep1>, quantity<R2, Rep2>> &&
             std::equality_comparable<typename std::common_type_t<quantity<R1, Rep1>, quantity<R2, Rep2>>::rep>
[[nodiscard]]
constexpr
bool
operator==(
    quantity<R1, Rep1> const& lhs,
    quantity<R2, Rep2> const& rhs);

Equality operator

template<
    auto R1,
    typename Rep1>
requires std::equality_comparable<Rep1> && requires { representation_values<Rep1>::zero(); }
[[nodiscard]]
constexpr
bool
operator==(
    quantity<R1, Rep1> const& lhs,
    /* implementation-defined */ rhs);

Equality operator

template<
    auto R1,
    auto PO1,
    typename Rep1,
    QuantityPointOf<mp_units::detail::get_absolute_point_origin(PO1)> QP2>
requires std::equality_comparable_with<quantity<R1, Rep1>, typename QP2::quantity_type>
[[nodiscard]]
constexpr
bool
operator==(
    quantity_point<R1, PO1, Rep1> const& lhs,
    QP2 const& rhs);

Equality operator

template<
    std::size_t N,
    std::size_t M,
    std::size_t N2>
[[nodiscard]]
consteval
bool
operator==(
    symbol_text<N, M> const& lhs,
    char const(& rhs)[])
requires requires { symbol_text<N, M>(rhs); };

Equality operator

template<
    std::size_t N,
    std::size_t M>
[[nodiscard]]
constexpr
bool
operator==(
    symbol_text<N, M> const& lhs,
    char rhs) noexcept
requires requires { symbol_text<N, M>(rhs); };

Equality operator

template<
    std::size_t N,
    std::size_t M,
    std::size_t N2,
    std::size_t M2>
[[nodiscard]]
constexpr
bool
operator==(
    symbol_text<N, M> const& lhs,
    symbol_text<N2, M2> const& rhs) noexcept;

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

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

Created with MrDocs