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

66 lines
2.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[concept.strictweakorder]
# 18 Concepts library [[concepts]](./#concepts)
## 18.7 Callable concepts [[concepts.callable]](concepts.callable#concept.strictweakorder)
### 18.7.7 Concept strict_weak_order [concept.strictweakorder]
[🔗](#concept:strict_weak_order)
`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](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/concepts.tex#L1303)
A [relation](concept.relation#concept:relation "18.7.5Concept relation[concept.relation]") models [strict_weak_order](#concept:strict_weak_order "18.7.7Concept strict_­weak_­order[concept.strictweakorder]") only if
it imposes a [*strict weak ordering*](#def:strict_weak_ordering) on its arguments[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/concepts.tex#L1307)
The term[*strict*](#def:strict) refers to the
requirement of an irreflexive relation (!comp(x, x) for all x),
and the term[*weak*](#def:weak) to requirements that are not as strong as
those for a total ordering,
but stronger than those for a partial
ordering[.](#2.sentence-1)
If we defineequiv(a, b) as!comp(a, b) && !comp(b, a),
then the requirements are thatcomp andequiv both be transitive relations:
- [(2.1)](#2.1)
comp(a, b) && comp(b, c) impliescomp(a, c)
- [(2.2)](#2.2)
equiv(a, b) && equiv(b, c) impliesequiv(a, c)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/concepts.tex#L1338)
[*Note [1](#note-1)*:
Under these conditions, it can be shown that
- [(3.1)](#3.1)
equiv is an equivalence relation,
- [(3.2)](#3.2)
comp induces a well-defined relation on the equivalence
classes determined byequiv, and
- [(3.3)](#3.3)
the induced relation is a strict total ordering[.](#3.sentence-1)
— *end note*]