tmp/tmp5s1ctyfd/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Preamble <a id="cmp.categories.pre">[[cmp.categories.pre]]</a>
|
| 2 |
+
|
| 3 |
+
The types `partial_ordering`, `weak_ordering`, and `strong_ordering` are
|
| 4 |
+
collectively termed the *comparison category types*. Each is specified
|
| 5 |
+
in terms of an exposition-only data member named `value` whose value
|
| 6 |
+
typically corresponds to that of an enumerator from one of the following
|
| 7 |
+
exposition-only enumerations:
|
| 8 |
+
|
| 9 |
+
``` cpp
|
| 10 |
+
enum class eq { equal = 0, equivalent = equal,
|
| 11 |
+
nonequal = 1, nonequivalent = nonequal }; // exposition only
|
| 12 |
+
enum class ord { less = -1, greater = 1 }; // exposition only
|
| 13 |
+
enum class ncmp { unordered = -127 }; // exposition only
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
[*Note 1*: The type `strong_ordering` corresponds to the term total
|
| 17 |
+
ordering in mathematics. — *end note*]
|
| 18 |
+
|
| 19 |
+
The relational and equality operators for the comparison category types
|
| 20 |
+
are specified with an anonymous parameter of unspecified type. This type
|
| 21 |
+
shall be selected by the implementation such that these parameters can
|
| 22 |
+
accept literal `0` as a corresponding argument.
|
| 23 |
+
|
| 24 |
+
[*Example 1*:
|
| 25 |
+
|
| 26 |
+
`nullptr_t`
|
| 27 |
+
|
| 28 |
+
meets this requirement.
|
| 29 |
+
|
| 30 |
+
— *end example*]
|
| 31 |
+
|
| 32 |
+
In this context, the behavior of a program that supplies an argument
|
| 33 |
+
other than a literal `0` is undefined.
|
| 34 |
+
|
| 35 |
+
For the purposes of subclause [[cmp.categories]], *substitutability* is
|
| 36 |
+
the property that `f(a) == f(b)` is `true` whenever `a == b` is `true`,
|
| 37 |
+
where `f` denotes a function that reads only comparison-salient state
|
| 38 |
+
that is accessible via the argument’s public const members.
|
| 39 |
+
|