Concept Subspace :: sus :: cmp :: StrongOrd

template <class Lhs, class Rhs = Lhs>
concept StrongOrd
requires
requires(const std::remove_reference_t<Lhs>& lhs,
                             const std::remove_reference_t<Rhs>& rhs) {
  { lhs <=> rhs } -> std::same_as<std::strong_ordering>;
}

Concept for types that form a unique total order (aka std::strong_ordering). Objects that sort the same for ordering must also compare as equal.

StrongOrd and Eq interations

While StrongOrd can report equality, it does not imply that the type satisfies Eq, and a separate operator== is required for that concept. For correctness, types that satisfy StrongOrd and Eq must have object which compare as equivalent for ording also compare as equal with operator==.

Generic code that requires a type to be StrongOrd should take care to use operator<=> and not operator== unless also requiring Eq.