[#mp_units-operator_eq-0ab] = xref:mp_units.adoc[mp_units]::operator== :relfileprefix: ../ :mrdocs: Equality operators == Synopses Declared in `<mp‐units/ext/fixed_string.h>` Compares two quantity characters lexicographically on (order, field) [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr bool operator==( xref:mp_units/quantity_character.adoc[quantity_character] lhs, xref:mp_units/quantity_character.adoc[quantity_character] rhs) = default; ---- [.small]#[_» more..._]# Checks whether a reference is equal to a unit [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:mp_units/Unit.adoc[Unit] U2> [[nodiscard]] consteval bool xref:mp_units/operator_eq-02f.adoc[operator==]( xref:mp_units/reference-0b2.adoc[reference] r, U2 u2); ---- [.small]#xref:mp_units/operator_eq-02f.adoc[_» more..._]# Checks whether two references are equal [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Q2, typename U2> [[nodiscard]] consteval bool xref:mp_units/operator_eq-07.adoc[operator==]( xref:mp_units/reference-0b2.adoc[reference] r1, xref:mp_units/reference-0b2.adoc[reference<Q2, U2>] r2); ---- [.small]#xref:mp_units/operator_eq-07.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename CharT, std::size_t N, std::size_t N2> [[nodiscard]] consteval bool xref:mp_units/operator_eq-02b.adoc[operator==]( xref:mp_units/basic_fixed_string-08.adoc[basic_fixed_string<CharT, N>] const& lhs, CharT const(& rhs)[]); ---- [.small]#xref:mp_units/operator_eq-02b.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename CharT, std::size_t N, std::size_t N2> [[nodiscard]] constexpr bool xref:mp_units/operator_eq-08.adoc[operator==]( xref:mp_units/basic_fixed_string-08.adoc[basic_fixed_string<CharT, N>] const& lhs, xref:mp_units/basic_fixed_string-08.adoc[basic_fixed_string<CharT, N2>] const& rhs); ---- [.small]#xref:mp_units/operator_eq-08.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Dimension.adoc[Dimension] Lhs, xref:mp_units/Dimension.adoc[Dimension] Rhs> [[nodiscard]] consteval bool xref:mp_units/operator_eq-0b.adoc[operator==]( Lhs lhs, Rhs rhs); ---- [.small]#xref:mp_units/operator_eq-0b.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Dimension.adoc[Dimension] Lhs, xref:mp_units/Dimension.adoc[Dimension] Rhs> [[nodiscard]] consteval bool xref:mp_units/operator_eq-00a.adoc[operator==]( Lhs lhs, Rhs rhs); ---- [.small]#xref:mp_units/operator_eq-00a.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Dimension.adoc[Dimension] Lhs, xref:mp_units/Dimension.adoc[Dimension] Rhs> [[nodiscard]] consteval bool xref:mp_units/operator_eq-0e.adoc[operator==]( Lhs lhs, Rhs rhs); ---- [.small]#xref:mp_units/operator_eq-0e.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< auto R1, typename Rep1, xref:mp_units/RepresentationOf.adoc[RepresentationOf<get_quantity_spec(R1)>] Value> requires ImplicitFromNumber<R1> && std::equality_comparable_with<Rep1, Value> [[nodiscard]] constexpr bool xref:mp_units/operator_eq-06.adoc[operator==]( xref:mp_units/quantity-01.adoc[quantity<R1, Rep1>] const& lhs, Value const& rhs); ---- [.small]#xref:mp_units/operator_eq-06.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 xref:mp_units/operator_eq-04.adoc[operator==]( xref:mp_units/quantity-01.adoc[quantity<R1, Rep1>] const& lhs, xref:mp_units/quantity-01.adoc[quantity<R2, Rep2>] const& rhs); ---- [.small]#xref:mp_units/operator_eq-04.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< auto R1, typename Rep1> requires std::equality_comparable<Rep1> && requires { representation_values<Rep1>::zero(); } [[nodiscard]] constexpr bool xref:mp_units/operator_eq-0ad.adoc[operator==]( xref:mp_units/quantity-01.adoc[quantity<R1, Rep1>] const& lhs, /* implementation-defined */ rhs); ---- [.small]#xref:mp_units/operator_eq-0ad.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< auto R1, auto PO1, typename Rep1, xref:mp_units/QuantityPointOf.adoc[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 xref:mp_units/operator_eq-05.adoc[operator==]( xref:mp_units/quantity_point-08.adoc[quantity_point<R1, PO1, Rep1>] const& lhs, QP2 const& rhs); ---- [.small]#xref:mp_units/operator_eq-05.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t N, std::size_t M, std::size_t N2> [[nodiscard]] consteval bool xref:mp_units/operator_eq-008.adoc[operator==]( xref:mp_units/symbol_text-032.adoc[symbol_text<N, M>] const& lhs, char const(& rhs)[]) requires requires { symbol_text<N, M>(rhs); }; ---- [.small]#xref:mp_units/operator_eq-008.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t N, std::size_t M> [[nodiscard]] constexpr bool xref:mp_units/operator_eq-000.adoc[operator==]( xref:mp_units/symbol_text-032.adoc[symbol_text<N, M>] const& lhs, char rhs) noexcept requires requires { symbol_text<N, M>(rhs); }; ---- [.small]#xref:mp_units/operator_eq-000.adoc[_» more..._]# Equality operator [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t N, std::size_t M, std::size_t N2, std::size_t M2> [[nodiscard]] constexpr bool xref:mp_units/operator_eq-09.adoc[operator==]( xref:mp_units/symbol_text-032.adoc[symbol_text<N, M>] const& lhs, xref:mp_units/symbol_text-032.adoc[symbol_text<N2, M2>] const& rhs) noexcept; ---- [.small]#xref:mp_units/operator_eq-09.adoc[_» 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 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]#