From Jason Turner

[comparisons.three.way]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp08jw1gzy/{from.md → to.md} +6 -13
tmp/tmp08jw1gzy/{from.md → to.md} RENAMED
@@ -1,38 +1,31 @@
1
  #### Class `compare_three_way` <a id="comparisons.three.way">[[comparisons.three.way]]</a>
2
 
3
- In this subclause, `BUILTIN-PTR-THREE-WAY(T, U)` for types `T` and `U`
4
- is a boolean constant expression. `BUILTIN-PTR-THREE-WAY(T, U)` is
5
- `true` if and only if `<=>` in the expression
6
-
7
- ``` cpp
8
- declval<T>() <=> declval<U>()
9
- ```
10
-
11
- resolves to a built-in operator comparing pointers.
12
-
13
  ``` cpp
 
14
  struct compare_three_way {
15
  template<class T, class U>
16
- requires three_way_comparable_with<T, U> || BUILTIN-PTR-THREE-WAY(T, U)
17
  constexpr auto operator()(T&& t, U&& u) const;
18
 
19
  using is_transparent = unspecified;
20
  };
 
21
  ```
22
 
23
  ``` cpp
24
  template<class T, class U>
25
- requires three_way_comparable_with<T, U> || BUILTIN-PTR-THREE-WAY(T, U)
26
  constexpr auto operator()(T&& t, U&& u) const;
27
  ```
28
 
 
 
29
  *Preconditions:* If the expression
30
  `std::forward<T>(t) <=> std::forward<U>(u)` results in a call to a
31
  built-in operator `<=>` comparing pointers of type `P`, the conversion
32
  sequences from both `T` and `U` to `P` are
33
- equality-preserving [[concepts.equality]].
 
34
 
35
  *Effects:*
36
 
37
  - If the expression `std::forward<T>(t) <=> std::forward<U>(u)` results
38
  in a call to a built-in operator `<=>` comparing pointers of type `P`,
 
1
  #### Class `compare_three_way` <a id="comparisons.three.way">[[comparisons.three.way]]</a>
2
 
 
 
 
 
 
 
 
 
 
 
3
  ``` cpp
4
+ namespace std {
5
  struct compare_three_way {
6
  template<class T, class U>
 
7
  constexpr auto operator()(T&& t, U&& u) const;
8
 
9
  using is_transparent = unspecified;
10
  };
11
+ }
12
  ```
13
 
14
  ``` cpp
15
  template<class T, class U>
 
16
  constexpr auto operator()(T&& t, U&& u) const;
17
  ```
18
 
19
+ *Constraints:* `T` and `U` satisfy `three_way_comparable_with`.
20
+
21
  *Preconditions:* If the expression
22
  `std::forward<T>(t) <=> std::forward<U>(u)` results in a call to a
23
  built-in operator `<=>` comparing pointers of type `P`, the conversion
24
  sequences from both `T` and `U` to `P` are
25
+ equality-preserving [[concepts.equality]]; otherwise, `T` and `U` model
26
+ `three_way_comparable_with`.
27
 
28
  *Effects:*
29
 
30
  - If the expression `std::forward<T>(t) <=> std::forward<U>(u)` results
31
  in a call to a built-in operator `<=>` comparing pointers of type `P`,