Files
cppdraft_translate/cppdraft/concept/strictweakorder.md
2025-10-25 03:02:53 +03:00

2.0 KiB
Raw Permalink Blame History

[concept.strictweakorder]

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_weak_order "18.7.7Concept strict_­weak_­order[concept.strictweakorder]") = [relation](concept.relation#concept:relation "18.7.5Concept relation[concept.relation]")<R, T, U>;

1

#

A relation models strict_weak_order only if it imposes a strict weak ordering on its arguments.

2

#

The termstrict refers to the requirement of an irreflexive relation (!comp(x, x) for all x), and the termweak to 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 thatcomp andequiv both be transitive relations:

comp(a, b) && comp(b, c) impliescomp(a, c)

equiv(a, b) && equiv(b, c) impliesequiv(a, c)

3

#

[Note 1:

Under these conditions, it can be shown that

equiv is an equivalence relation,

comp induces a well-defined relation on the equivalence classes determined byequiv, and

the induced relation is a strict total ordering.

— end note]