Skip to content

mp_units::operator<=>

Three-way comparison operator

Synopsis

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

template<auto R1, auto PO1, typename Rep1,
         /* implementation-defined */ QP2>
  requires std::three_way_comparable_with<quantity<R1, Rep1>, typename QP2::quantity_type>
[[nodiscard]] constexpr auto operator<=>(quantity_point<R1, PO1, Rep1> const& lhs, QP2 const& rhs)
  requires(PO1 == QP2::point_origin) ||
          requires { lhs - lhs.absolute_point_origin <=> rhs - rhs.absolute_point_origin; };

Note

This function is a hidden friend of quantity_point, declared inside an implementation-defined base class: it can be found only through argument-dependent lookup.

Return Value

The relative order of the objects

Note

The return value should not be discarded.

Parameters

NameDescription
lhsThe left operand
rhsThe right operand