[concept.totallyordered] (original) (raw)
18 Concepts library [concepts]
18.5 Comparison concepts [concepts.compare]
18.5.4 Concept totally_ordered [concept.totallyordered]
Given a type T, let a, b, and c be lvalues of type const remove_reference_t<T>.
T models totally_ordered only if
- Exactly one of bool(a < b), bool(a > b), orbool(a == b) is true.
- If bool(a < b) and bool(b < c), thenbool(a < c).
- bool(a <= b) == !bool(b < a).
- bool(a >= b) == !bool(a < b).
Given types T and U, let t be an lvalue of type const remove_reference_t<T>,u be an lvalue of type const remove_reference_t<U>, and C be:common_reference_t<const remove_reference_t<T>&, const remove_reference_t<U>&> T and U modeltotally_ordered_with<T, U> only if
- bool(t < u) == bool(C(t) < C(u)).
- bool(t > u) == bool(C(t) > C(u)).
- bool(t <= u) == bool(C(t) <= C(u)).
- bool(t >= u) == bool(C(t) >= C(u)).
- bool(u < t) == bool(C(u) < C(t)).
- bool(u > t) == bool(C(u) > C(t)).
- bool(u <= t) == bool(C(u) <= C(t)).
- bool(u >= t) == bool(C(u) >= C(t)).