tmp/tmpoofwjhw7/{from.md → to.md}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
### Three-way comparison <a id="class.spaceship">[[class.spaceship]]</a>
|
| 2 |
|
| 3 |
The *synthesized three-way comparison* of type `R` [[cmp.categories]] of
|
| 4 |
glvalues `a` and `b` of the same type is defined as follows:
|
| 5 |
|
| 6 |
-
- If `a <=> b` is usable [[class.compare.default]]
|
| 7 |
-
`static_cast<R>(a <=> b)`.
|
| 8 |
- Otherwise, if overload resolution for `a <=> b` is performed and finds
|
| 9 |
at least one viable candidate, the synthesized three-way comparison is
|
| 10 |
not defined.
|
| 11 |
- Otherwise, if `R` is not a comparison category type, or either the
|
| 12 |
expression `a == b` or the expression `a < b` is not usable, the
|
|
@@ -29,13 +29,13 @@ glvalues `a` and `b` of the same type is defined as follows:
|
|
| 29 |
a < b ? partial_ordering::less :
|
| 30 |
b < a ? partial_ordering::greater :
|
| 31 |
partial_ordering::unordered
|
| 32 |
```
|
| 33 |
|
| 34 |
-
[*Note 1*: A synthesized three-way comparison
|
| 35 |
-
|
| 36 |
-
|
| 37 |
|
| 38 |
Let `R` be the declared return type of a defaulted three-way comparison
|
| 39 |
operator function, and let `xᵢ` be the elements of the expanded list of
|
| 40 |
subobjects for an object `x` of type `C`.
|
| 41 |
|
|
|
|
| 1 |
### Three-way comparison <a id="class.spaceship">[[class.spaceship]]</a>
|
| 2 |
|
| 3 |
The *synthesized three-way comparison* of type `R` [[cmp.categories]] of
|
| 4 |
glvalues `a` and `b` of the same type is defined as follows:
|
| 5 |
|
| 6 |
+
- If `a <=> b` is usable [[class.compare.default]] and can be explicitly
|
| 7 |
+
converted to `R` using `static_cast`, `static_cast<R>(a <=> b)`.
|
| 8 |
- Otherwise, if overload resolution for `a <=> b` is performed and finds
|
| 9 |
at least one viable candidate, the synthesized three-way comparison is
|
| 10 |
not defined.
|
| 11 |
- Otherwise, if `R` is not a comparison category type, or either the
|
| 12 |
expression `a == b` or the expression `a < b` is not usable, the
|
|
|
|
| 29 |
a < b ? partial_ordering::less :
|
| 30 |
b < a ? partial_ordering::greater :
|
| 31 |
partial_ordering::unordered
|
| 32 |
```
|
| 33 |
|
| 34 |
+
[*Note 1*: A synthesized three-way comparison is ill-formed if overload
|
| 35 |
+
resolution finds usable candidates that do not otherwise meet the
|
| 36 |
+
requirements implied by the defined expression. — *end note*]
|
| 37 |
|
| 38 |
Let `R` be the declared return type of a defaulted three-way comparison
|
| 39 |
operator function, and let `xᵢ` be the elements of the expanded list of
|
| 40 |
subobjects for an object `x` of type `C`.
|
| 41 |
|