From Jason Turner

[class.spaceship]

Diff to HTML by rtfpessoa

tmp/tmpl2mbrftc/{from.md → to.md} RENAMED
@@ -3,13 +3,13 @@
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
13
  synthesized three-way comparison is not defined.
14
  - Otherwise, if `R` is `strong_ordering`, then
15
  ``` cpp
@@ -46,19 +46,19 @@ subobjects for an object `x` of type `C`.
46
  common comparison type (see below) of `R₀`, `R₁`, …, `R_n-1`.
47
  - Otherwise, `R` shall not contain a placeholder type. If the
48
  synthesized three-way comparison of type `R` between any objects `xᵢ`
49
  and `xᵢ` is not defined, the operator function is defined as deleted.
50
 
51
- The return value `V` of type `R` of the defaulted three-way comparison
52
  operator function with parameters `x` and `y` of the same type is
53
  determined by comparing corresponding elements `xᵢ` and `yᵢ` in the
54
  expanded lists of subobjects for `x` and `y` (in increasing index order)
55
  until the first index i where the synthesized three-way comparison of
56
  type `R` between `xᵢ` and `yᵢ` yields a result value `vᵢ` where
57
- `vᵢ` `!=` 0, contextually converted to `bool`, yields `true`; `V` is a
58
- copy of `vᵢ`. If no such index exists, `V` is
59
- `static_cast<R>(std::strong_ordering::equal)`.
60
 
61
  The *common comparison type* `U` of a possibly-empty list of n
62
  comparison category types `T₀`, `T₁`, …, `T_n-1` is defined as follows:
63
 
64
  - If at least one `Tᵢ` is `std::partial_ordering`, `U` is
 
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 `a <=> b` is usable or overload resolution for `a <=> b`
9
+ is performed and finds at least one viable candidate, the synthesized
10
+ three-way comparison is 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
13
  synthesized three-way comparison is not defined.
14
  - Otherwise, if `R` is `strong_ordering`, then
15
  ``` cpp
 
46
  common comparison type (see below) of `R₀`, `R₁`, …, `R_n-1`.
47
  - Otherwise, `R` shall not contain a placeholder type. If the
48
  synthesized three-way comparison of type `R` between any objects `xᵢ`
49
  and `xᵢ` is not defined, the operator function is defined as deleted.
50
 
51
+ The return value of type `R` of the defaulted three-way comparison
52
  operator function with parameters `x` and `y` of the same type is
53
  determined by comparing corresponding elements `xᵢ` and `yᵢ` in the
54
  expanded lists of subobjects for `x` and `y` (in increasing index order)
55
  until the first index i where the synthesized three-way comparison of
56
  type `R` between `xᵢ` and `yᵢ` yields a result value `vᵢ` where
57
+ `vᵢ` `!=` 0, contextually converted to `bool`, yields `true`. The return
58
+ value is a copy of `vᵢ` if such an index exists and
59
+ `static_cast<R>(std::strong_ordering::equal)` otherwise.
60
 
61
  The *common comparison type* `U` of a possibly-empty list of n
62
  comparison category types `T₀`, `T₁`, …, `T_n-1` is defined as follows:
63
 
64
  - If at least one `Tᵢ` is `std::partial_ordering`, `U` is