From Jason Turner

[comparisons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp1myyrfws/{from.md → to.md} +9 -14
tmp/tmp1myyrfws/{from.md → to.md} RENAMED
@@ -1,9 +1,11 @@
1
  ### Comparisons <a id="comparisons">[[comparisons]]</a>
2
 
 
 
3
  The library provides basic function object classes for all of the
4
- comparison operators in the language ([[expr.rel]], [[expr.eq]]).
5
 
6
  For templates `less`, `greater`, `less_equal`, and `greater_equal`, the
7
  specializations for any pointer type yield a result consistent with the
8
  implementation-defined strict total order over pointers
9
  [[defns.order.ptr]].
@@ -198,41 +200,34 @@ template<class T, class U> constexpr auto operator()(T&& t, U&& u) const
198
 
199
  *Returns:* `std::forward<T>(t) <= std::forward<U>(u)`.
200
 
201
  #### Class `compare_three_way` <a id="comparisons.three.way">[[comparisons.three.way]]</a>
202
 
203
- In this subclause, `BUILTIN-PTR-THREE-WAY(T, U)` for types `T` and `U`
204
- is a boolean constant expression. `BUILTIN-PTR-THREE-WAY(T, U)` is
205
- `true` if and only if `<=>` in the expression
206
-
207
- ``` cpp
208
- declval<T>() <=> declval<U>()
209
- ```
210
-
211
- resolves to a built-in operator comparing pointers.
212
-
213
  ``` cpp
 
214
  struct compare_three_way {
215
  template<class T, class U>
216
- requires three_way_comparable_with<T, U> || BUILTIN-PTR-THREE-WAY(T, U)
217
  constexpr auto operator()(T&& t, U&& u) const;
218
 
219
  using is_transparent = unspecified;
220
  };
 
221
  ```
222
 
223
  ``` cpp
224
  template<class T, class U>
225
- requires three_way_comparable_with<T, U> || BUILTIN-PTR-THREE-WAY(T, U)
226
  constexpr auto operator()(T&& t, U&& u) const;
227
  ```
228
 
 
 
229
  *Preconditions:* If the expression
230
  `std::forward<T>(t) <=> std::forward<U>(u)` results in a call to a
231
  built-in operator `<=>` comparing pointers of type `P`, the conversion
232
  sequences from both `T` and `U` to `P` are
233
- equality-preserving [[concepts.equality]].
 
234
 
235
  *Effects:*
236
 
237
  - If the expression `std::forward<T>(t) <=> std::forward<U>(u)` results
238
  in a call to a built-in operator `<=>` comparing pointers of type `P`,
 
1
  ### Comparisons <a id="comparisons">[[comparisons]]</a>
2
 
3
+ #### General <a id="comparisons.general">[[comparisons.general]]</a>
4
+
5
  The library provides basic function object classes for all of the
6
+ comparison operators in the language [[expr.rel]], [[expr.eq]].
7
 
8
  For templates `less`, `greater`, `less_equal`, and `greater_equal`, the
9
  specializations for any pointer type yield a result consistent with the
10
  implementation-defined strict total order over pointers
11
  [[defns.order.ptr]].
 
200
 
201
  *Returns:* `std::forward<T>(t) <= std::forward<U>(u)`.
202
 
203
  #### Class `compare_three_way` <a id="comparisons.three.way">[[comparisons.three.way]]</a>
204
 
 
 
 
 
 
 
 
 
 
 
205
  ``` cpp
206
+ namespace std {
207
  struct compare_three_way {
208
  template<class T, class U>
 
209
  constexpr auto operator()(T&& t, U&& u) const;
210
 
211
  using is_transparent = unspecified;
212
  };
213
+ }
214
  ```
215
 
216
  ``` cpp
217
  template<class T, class U>
 
218
  constexpr auto operator()(T&& t, U&& u) const;
219
  ```
220
 
221
+ *Constraints:* `T` and `U` satisfy `three_way_comparable_with`.
222
+
223
  *Preconditions:* If the expression
224
  `std::forward<T>(t) <=> std::forward<U>(u)` results in a call to a
225
  built-in operator `<=>` comparing pointers of type `P`, the conversion
226
  sequences from both `T` and `U` to `P` are
227
+ equality-preserving [[concepts.equality]]; otherwise, `T` and `U` model
228
+ `three_way_comparable_with`.
229
 
230
  *Effects:*
231
 
232
  - If the expression `std::forward<T>(t) <=> std::forward<U>(u)` results
233
  in a call to a built-in operator `<=>` comparing pointers of type `P`,