[concept.strictweakorder] (original) (raw)
18 Concepts library [concepts]
18.7 Callable concepts [concepts.callable]
18.7.7 Concept strict_weak_order [concept.strictweakorder]
template<class R, class T, class U> concept [strict_weak_order](#concept:strict%5Fweak%5Forder "18.7.7 Concept strict_weak_order [concept.strictweakorder]") = [relation](concept.relation#concept:relation "18.7.5 Concept relation [concept.relation]")<R, T, U>;
The termstrictrefers to the requirement of an irreflexive relation (!comp(x, x) for all x), and the termweakto requirements that are not as strong as those for a total ordering, but stronger than those for a partial ordering.
If we defineequiv(a, b)as!comp(a, b) && !comp(b, a), then the requirements are thatcompandequivboth be transitive relations:
- comp(a, b) && comp(b, c)impliescomp(a, c)
- equiv(a, b) && equiv(b, c)impliesequiv(a, c)
[Note 1:
Under these conditions, it can be shown that
- equivis an equivalence relation,
- compinduces a well-defined relation on the equivalence classes determined byequiv, and
- the induced relation is a strict total ordering.
— _end note_]