From Jason Turner

[comparisons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpecsvgcq6/{from.md → to.md} +130 -70
tmp/tmpecsvgcq6/{from.md → to.md} RENAMED
@@ -1,141 +1,201 @@
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
  ``` cpp
7
  template <class T = void> struct equal_to {
8
  constexpr bool operator()(const T& x, const T& y) const;
9
- typedef T first_argument_type;
10
- typedef T second_argument_type;
11
- typedef bool result_type;
12
  };
13
  ```
14
 
15
- `operator()` returns `x == y`.
16
-
17
- ``` cpp
18
- template <class T = void> struct not_equal_to {
19
- constexpr bool operator()(const T& x, const T& y) const;
20
- typedef T first_argument_type;
21
- typedef T second_argument_type;
22
- typedef bool result_type;
23
- };
24
- ```
25
-
26
- `operator()` returns `x != y`.
27
-
28
- ``` cpp
29
- template <class T = void> struct greater {
30
- constexpr bool operator()(const T& x, const T& y) const;
31
- typedef T first_argument_type;
32
- typedef T second_argument_type;
33
- typedef bool result_type;
34
- };
35
- ```
36
-
37
- `operator()` returns `x > y`.
38
-
39
  ``` cpp
40
- template <class T = void> struct less {
41
  constexpr bool operator()(const T& x, const T& y) const;
42
- typedef T first_argument_type;
43
- typedef T second_argument_type;
44
- typedef bool result_type;
45
- };
46
- ```
47
-
48
- `operator()` returns `x < y`.
49
-
50
- ``` cpp
51
- template <class T = void> struct greater_equal {
52
- constexpr bool operator()(const T& x, const T& y) const;
53
- typedef T first_argument_type;
54
- typedef T second_argument_type;
55
- typedef bool result_type;
56
- };
57
- ```
58
-
59
- `operator()` returns `x >= y`.
60
-
61
- ``` cpp
62
- template <class T = void> struct less_equal {
63
- constexpr bool operator()(const T& x, const T& y) const;
64
- typedef T first_argument_type;
65
- typedef T second_argument_type;
66
- typedef bool result_type;
67
- };
68
  ```
69
 
70
- `operator()` returns `x <= y`.
71
 
72
  ``` cpp
73
  template <> struct equal_to<void> {
74
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
75
  -> decltype(std::forward<T>(t) == std::forward<U>(u));
76
 
77
- typedef unspecified is_transparent;
78
  };
79
  ```
80
 
81
- `operator()` returns `std::forward<T>(t) == std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
  ``` cpp
84
  template <> struct not_equal_to<void> {
85
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
86
  -> decltype(std::forward<T>(t) != std::forward<U>(u));
87
 
88
- typedef unspecified is_transparent;
89
  };
90
  ```
91
 
92
- `operator()` returns `std::forward<T>(t) != std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
  ``` cpp
95
  template <> struct greater<void> {
96
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
97
  -> decltype(std::forward<T>(t) > std::forward<U>(u));
98
 
99
- typedef unspecified is_transparent;
100
  };
101
  ```
102
 
103
- `operator()` returns `std::forward<T>(t) > std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  ``` cpp
106
  template <> struct less<void> {
107
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
108
  -> decltype(std::forward<T>(t) < std::forward<U>(u));
109
 
110
- typedef unspecified is_transparent;
111
  };
112
  ```
113
 
114
- `operator()` returns `std::forward<T>(t) < std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  ``` cpp
117
  template <> struct greater_equal<void> {
118
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
119
  -> decltype(std::forward<T>(t) >= std::forward<U>(u));
120
 
121
- typedef unspecified is_transparent;
122
  };
123
  ```
124
 
125
- `operator()` returns `std::forward<T>(t) >= std::forward<U>(u)`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
  ``` cpp
128
  template <> struct less_equal<void> {
129
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
130
  -> decltype(std::forward<T>(t) <= std::forward<U>(u));
131
 
132
- typedef unspecified is_transparent;
133
  };
134
  ```
135
 
136
- `operator()` returns `std::forward<T>(t) <= std::forward<U>(u)`.
 
 
 
137
 
138
- For templates `greater`, `less`, `greater_equal`, and `less_equal`, the
139
- specializations for any pointer type yield a total order, even if the
140
- built-in operators `<`, `>`, `<=`, `>=` do not.
141
 
 
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 strict total order that is
8
+ consistent among those specializations and is also consistent with the
9
+ partial order imposed by the built-in operators `<`, `>`, `<=`, `>=`.
10
+
11
+ [*Note 1*: When `a < b` is well-defined for pointers `a` and `b` of
12
+ type `P`, this implies `(a < b) == less<P>(a, b)`,
13
+ `(a > b) == greater<P>(a, b)`, and so forth. — *end note*]
14
+
15
+ For template specializations `less<void>`, `greater<void>`,
16
+ `less_equal<void>`, and `greater_equal<void>`, if the call operator
17
+ calls a built-in operator comparing pointers, the call operator yields a
18
+ strict total order that is consistent among those specializations and is
19
+ also consistent with the partial order imposed by those built-in
20
+ operators.
21
+
22
+ #### Class template `equal_to` <a id="comparisons.equal_to">[[comparisons.equal_to]]</a>
23
+
24
  ``` cpp
25
  template <class T = void> struct equal_to {
26
  constexpr bool operator()(const T& x, const T& y) const;
 
 
 
27
  };
28
  ```
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  ``` cpp
 
31
  constexpr bool operator()(const T& x, const T& y) const;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  ```
33
 
34
+ *Returns:* `x == y`.
35
 
36
  ``` cpp
37
  template <> struct equal_to<void> {
38
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
39
  -> decltype(std::forward<T>(t) == std::forward<U>(u));
40
 
41
+ using is_transparent = unspecified;
42
  };
43
  ```
44
 
45
+ ``` cpp
46
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
47
+ -> decltype(std::forward<T>(t) == std::forward<U>(u));
48
+ ```
49
+
50
+ *Returns:* `std::forward<T>(t) == std::forward<U>(u)`.
51
+
52
+ #### Class template `not_equal_to` <a id="comparisons.not_equal_to">[[comparisons.not_equal_to]]</a>
53
+
54
+ ``` cpp
55
+ template <class T = void> struct not_equal_to {
56
+ constexpr bool operator()(const T& x, const T& y) const;
57
+ };
58
+ ```
59
+
60
+ ``` cpp
61
+ constexpr bool operator()(const T& x, const T& y) const;
62
+ ```
63
+
64
+ *Returns:* `x != y`.
65
 
66
  ``` cpp
67
  template <> struct not_equal_to<void> {
68
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
69
  -> decltype(std::forward<T>(t) != std::forward<U>(u));
70
 
71
+ using is_transparent = unspecified;
72
  };
73
  ```
74
 
75
+ ``` cpp
76
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
77
+ -> decltype(std::forward<T>(t) != std::forward<U>(u));
78
+ ```
79
+
80
+ *Returns:* `std::forward<T>(t) != std::forward<U>(u)`.
81
+
82
+ #### Class template `greater` <a id="comparisons.greater">[[comparisons.greater]]</a>
83
+
84
+ ``` cpp
85
+ template <class T = void> struct greater {
86
+ constexpr bool operator()(const T& x, const T& y) const;
87
+ };
88
+ ```
89
+
90
+ ``` cpp
91
+ constexpr bool operator()(const T& x, const T& y) const;
92
+ ```
93
+
94
+ *Returns:* `x > y`.
95
 
96
  ``` cpp
97
  template <> struct greater<void> {
98
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
99
  -> decltype(std::forward<T>(t) > std::forward<U>(u));
100
 
101
+ using is_transparent = unspecified;
102
  };
103
  ```
104
 
105
+ ``` cpp
106
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
107
+ -> decltype(std::forward<T>(t) > std::forward<U>(u));
108
+ ```
109
+
110
+ *Returns:* `std::forward<T>(t) > std::forward<U>(u)`.
111
+
112
+ #### Class template `less` <a id="comparisons.less">[[comparisons.less]]</a>
113
+
114
+ ``` cpp
115
+ template <class T = void> struct less {
116
+ constexpr bool operator()(const T& x, const T& y) const;
117
+ };
118
+ ```
119
+
120
+ ``` cpp
121
+ constexpr bool operator()(const T& x, const T& y) const;
122
+ ```
123
+
124
+ *Returns:* `x < y`.
125
 
126
  ``` cpp
127
  template <> struct less<void> {
128
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
129
  -> decltype(std::forward<T>(t) < std::forward<U>(u));
130
 
131
+ using is_transparent = unspecified;
132
  };
133
  ```
134
 
135
+ ``` cpp
136
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
137
+ -> decltype(std::forward<T>(t) < std::forward<U>(u));
138
+ ```
139
+
140
+ *Returns:* `std::forward<T>(t) < std::forward<U>(u)`.
141
+
142
+ #### Class template `greater_equal` <a id="comparisons.greater_equal">[[comparisons.greater_equal]]</a>
143
+
144
+ ``` cpp
145
+ template <class T = void> struct greater_equal {
146
+ constexpr bool operator()(const T& x, const T& y) const;
147
+ };
148
+ ```
149
+
150
+ ``` cpp
151
+ constexpr bool operator()(const T& x, const T& y) const;
152
+ ```
153
+
154
+ *Returns:* `x >= y`.
155
 
156
  ``` cpp
157
  template <> struct greater_equal<void> {
158
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
159
  -> decltype(std::forward<T>(t) >= std::forward<U>(u));
160
 
161
+ using is_transparent = unspecified;
162
  };
163
  ```
164
 
165
+ ``` cpp
166
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
167
+ -> decltype(std::forward<T>(t) >= std::forward<U>(u));
168
+ ```
169
+
170
+ *Returns:* `std::forward<T>(t) >= std::forward<U>(u)`.
171
+
172
+ #### Class template `less_equal` <a id="comparisons.less_equal">[[comparisons.less_equal]]</a>
173
+
174
+ ``` cpp
175
+ template <class T = void> struct less_equal {
176
+ constexpr bool operator()(const T& x, const T& y) const;
177
+ };
178
+ ```
179
+
180
+ ``` cpp
181
+ constexpr bool operator()(const T& x, const T& y) const;
182
+ ```
183
+
184
+ *Returns:* `x <= y`.
185
 
186
  ``` cpp
187
  template <> struct less_equal<void> {
188
  template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
189
  -> decltype(std::forward<T>(t) <= std::forward<U>(u));
190
 
191
+ using is_transparent = unspecified;
192
  };
193
  ```
194
 
195
+ ``` cpp
196
+ template <class T, class U> constexpr auto operator()(T&& t, U&& u) const
197
+ -> decltype(std::forward<T>(t) <= std::forward<U>(u));
198
+ ```
199
 
200
+ *Returns:* `std::forward<T>(t) <= std::forward<U>(u)`.
 
 
201