1 | //===----------------------------------------------------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
10 | |
11 | // template<class T, class U> |
12 | // concept equality_comparable_with = // see below |
13 | |
14 | #include <concepts> |
15 | |
16 | #include <array> |
17 | #include <cstddef> |
18 | #include <deque> |
19 | #include <forward_list> |
20 | #include <list> |
21 | #include <map> |
22 | #include <optional> |
23 | #include <vector> |
24 | |
25 | #include "test_macros.h" |
26 | |
27 | #ifndef TEST_HAS_NO_THREADS |
28 | # include <mutex> |
29 | #endif |
30 | |
31 | #include "compare_types.h" |
32 | |
33 | template <class T, class U> |
34 | constexpr bool check_equality_comparable_with() { |
35 | constexpr bool result = std::equality_comparable_with<T, U>; |
36 | static_assert(std::equality_comparable_with<U, T> == result); |
37 | static_assert(std::equality_comparable_with<T, U const> == result); |
38 | static_assert(std::equality_comparable_with<T const, U const> == result); |
39 | static_assert(std::equality_comparable_with<T, U const&> == result); |
40 | static_assert(std::equality_comparable_with<T const, U const&> == result); |
41 | static_assert(std::equality_comparable_with<T&, U const> == result); |
42 | static_assert(std::equality_comparable_with<T const&, U const> == result); |
43 | static_assert(std::equality_comparable_with<T&, U const&> == result); |
44 | static_assert(std::equality_comparable_with<T const&, U const&> == result); |
45 | static_assert(std::equality_comparable_with<T, U const&&> == result); |
46 | static_assert(std::equality_comparable_with<T const, U const&&> == result); |
47 | static_assert(std::equality_comparable_with<T&, U const&&> == result); |
48 | static_assert(std::equality_comparable_with<T const&, U const&&> == result); |
49 | static_assert(std::equality_comparable_with<T&&, U const> == result); |
50 | static_assert(std::equality_comparable_with<T const&&, U const> == result); |
51 | static_assert(std::equality_comparable_with<T&&, U const&> == result); |
52 | static_assert(std::equality_comparable_with<T const&&, U const&> == result); |
53 | static_assert(std::equality_comparable_with<T&&, U const&&> == result); |
54 | static_assert(std::equality_comparable_with<T const&&, U const&&> == result); |
55 | return result; |
56 | } |
57 | |
58 | namespace fundamentals { |
59 | static_assert(check_equality_comparable_with<int, int>()); |
60 | static_assert(check_equality_comparable_with<int, bool>()); |
61 | static_assert(check_equality_comparable_with<int, char>()); |
62 | static_assert(check_equality_comparable_with<int, wchar_t>()); |
63 | static_assert(check_equality_comparable_with<int, double>()); |
64 | static_assert(!check_equality_comparable_with<int, int*>()); |
65 | static_assert(!check_equality_comparable_with<int, int[5]>()); |
66 | static_assert(!check_equality_comparable_with<int, int (*)()>()); |
67 | static_assert(!check_equality_comparable_with<int, int (&)()>()); |
68 | |
69 | struct S {}; |
70 | static_assert(!check_equality_comparable_with<int, int S::*>()); |
71 | static_assert(!check_equality_comparable_with<int, int (S::*)()>()); |
72 | static_assert(!check_equality_comparable_with<int, int (S::*)() noexcept>()); |
73 | static_assert(!check_equality_comparable_with<int, int (S::*)() const>()); |
74 | static_assert( |
75 | !check_equality_comparable_with<int, int (S::*)() const noexcept>()); |
76 | static_assert(!check_equality_comparable_with<int, int (S::*)() volatile>()); |
77 | static_assert( |
78 | !check_equality_comparable_with<int, int (S::*)() volatile noexcept>()); |
79 | static_assert( |
80 | !check_equality_comparable_with<int, int (S::*)() const volatile>()); |
81 | static_assert(!check_equality_comparable_with< |
82 | int, int (S::*)() const volatile noexcept>()); |
83 | static_assert(!check_equality_comparable_with<int, int (S::*)() &>()); |
84 | static_assert(!check_equality_comparable_with<int, int (S::*)() & noexcept>()); |
85 | static_assert(!check_equality_comparable_with<int, int (S::*)() const&>()); |
86 | static_assert( |
87 | !check_equality_comparable_with<int, int (S::*)() const & noexcept>()); |
88 | static_assert(!check_equality_comparable_with<int, int (S::*)() volatile&>()); |
89 | static_assert( |
90 | !check_equality_comparable_with<int, int (S::*)() volatile & noexcept>()); |
91 | static_assert( |
92 | !check_equality_comparable_with<int, int (S::*)() const volatile&>()); |
93 | static_assert(!check_equality_comparable_with<int, int (S::*)() const volatile & |
94 | noexcept>()); |
95 | static_assert(!check_equality_comparable_with<int, int (S::*)() &&>()); |
96 | static_assert(!check_equality_comparable_with < int, |
97 | int (S::*)() && noexcept > ()); |
98 | static_assert(!check_equality_comparable_with<int, int (S::*)() const&&>()); |
99 | static_assert(!check_equality_comparable_with < int, |
100 | int (S::*)() const&& noexcept > ()); |
101 | static_assert(!check_equality_comparable_with<int, int (S::*)() volatile&&>()); |
102 | static_assert(!check_equality_comparable_with < int, |
103 | int (S::*)() volatile&& noexcept > ()); |
104 | static_assert( |
105 | !check_equality_comparable_with<int, int (S::*)() const volatile&&>()); |
106 | static_assert(!check_equality_comparable_with < int, |
107 | int (S::*)() const volatile&& noexcept > ()); |
108 | |
109 | static_assert(check_equality_comparable_with<int*, int*>()); |
110 | // Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet. |
111 | #if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG) |
112 | static_assert(check_equality_comparable_with<int*, int[5]>()); |
113 | #else |
114 | static_assert(!check_equality_comparable_with<int*, int[5]>()); |
115 | #endif |
116 | static_assert(!check_equality_comparable_with<int*, int (*)()>()); |
117 | static_assert(!check_equality_comparable_with<int*, int (&)()>()); |
118 | static_assert(!check_equality_comparable_with<int*, int (S::*)()>()); |
119 | static_assert(!check_equality_comparable_with<int*, int (S::*)() noexcept>()); |
120 | static_assert(!check_equality_comparable_with<int*, int (S::*)() const>()); |
121 | static_assert( |
122 | !check_equality_comparable_with<int*, int (S::*)() const noexcept>()); |
123 | static_assert(!check_equality_comparable_with<int*, int (S::*)() volatile>()); |
124 | static_assert( |
125 | !check_equality_comparable_with<int*, int (S::*)() volatile noexcept>()); |
126 | static_assert( |
127 | !check_equality_comparable_with<int*, int (S::*)() const volatile>()); |
128 | static_assert(!check_equality_comparable_with< |
129 | int*, int (S::*)() const volatile noexcept>()); |
130 | static_assert(!check_equality_comparable_with<int*, int (S::*)() &>()); |
131 | static_assert(!check_equality_comparable_with<int*, int (S::*)() & noexcept>()); |
132 | static_assert(!check_equality_comparable_with<int*, int (S::*)() const&>()); |
133 | static_assert( |
134 | !check_equality_comparable_with<int*, int (S::*)() const & noexcept>()); |
135 | static_assert(!check_equality_comparable_with<int*, int (S::*)() volatile&>()); |
136 | static_assert( |
137 | !check_equality_comparable_with<int*, int (S::*)() volatile & noexcept>()); |
138 | static_assert( |
139 | !check_equality_comparable_with<int*, int (S::*)() const volatile&>()); |
140 | static_assert(!check_equality_comparable_with< |
141 | int*, int (S::*)() const volatile & noexcept>()); |
142 | static_assert(!check_equality_comparable_with<int*, int (S::*)() &&>()); |
143 | static_assert(!check_equality_comparable_with < int*, |
144 | int (S::*)() && noexcept > ()); |
145 | static_assert(!check_equality_comparable_with<int*, int (S::*)() const&&>()); |
146 | static_assert(!check_equality_comparable_with < int*, |
147 | int (S::*)() const&& noexcept > ()); |
148 | static_assert(!check_equality_comparable_with<int*, int (S::*)() volatile&&>()); |
149 | static_assert(!check_equality_comparable_with < int*, |
150 | int (S::*)() volatile&& noexcept > ()); |
151 | static_assert( |
152 | !check_equality_comparable_with<int*, int (S::*)() const volatile&&>()); |
153 | static_assert(!check_equality_comparable_with < int*, |
154 | int (S::*)() const volatile&& noexcept > ()); |
155 | |
156 | // Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet. |
157 | #if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG) |
158 | static_assert(check_equality_comparable_with<int[5], int[5]>()); |
159 | #else |
160 | static_assert(!check_equality_comparable_with<int[5], int[5]>()); |
161 | #endif |
162 | static_assert(!check_equality_comparable_with<int[5], int (*)()>()); |
163 | static_assert(!check_equality_comparable_with<int[5], int (&)()>()); |
164 | static_assert(!check_equality_comparable_with<int[5], int (S::*)()>()); |
165 | static_assert(!check_equality_comparable_with<int[5], int (S::*)() noexcept>()); |
166 | static_assert(!check_equality_comparable_with<int[5], int (S::*)() const>()); |
167 | static_assert( |
168 | !check_equality_comparable_with<int[5], int (S::*)() const noexcept>()); |
169 | static_assert(!check_equality_comparable_with<int[5], int (S::*)() volatile>()); |
170 | static_assert( |
171 | !check_equality_comparable_with<int[5], int (S::*)() volatile noexcept>()); |
172 | static_assert( |
173 | !check_equality_comparable_with<int[5], int (S::*)() const volatile>()); |
174 | static_assert(!check_equality_comparable_with< |
175 | int[5], int (S::*)() const volatile noexcept>()); |
176 | static_assert(!check_equality_comparable_with<int[5], int (S::*)() &>()); |
177 | static_assert( |
178 | !check_equality_comparable_with<int[5], int (S::*)() & noexcept>()); |
179 | static_assert(!check_equality_comparable_with<int[5], int (S::*)() const&>()); |
180 | static_assert( |
181 | !check_equality_comparable_with<int[5], int (S::*)() const & noexcept>()); |
182 | static_assert( |
183 | !check_equality_comparable_with<int[5], int (S::*)() volatile&>()); |
184 | static_assert(!check_equality_comparable_with<int[5], int (S::*)() volatile & |
185 | noexcept>()); |
186 | static_assert( |
187 | !check_equality_comparable_with<int[5], int (S::*)() const volatile&>()); |
188 | static_assert(!check_equality_comparable_with< |
189 | int[5], int (S::*)() const volatile & noexcept>()); |
190 | static_assert(!check_equality_comparable_with<int[5], int (S::*)() &&>()); |
191 | static_assert(!check_equality_comparable_with < int[5], |
192 | int (S::*)() && noexcept > ()); |
193 | static_assert(!check_equality_comparable_with<int[5], int (S::*)() const&&>()); |
194 | static_assert(!check_equality_comparable_with < int[5], |
195 | int (S::*)() const&& noexcept > ()); |
196 | static_assert( |
197 | !check_equality_comparable_with<int[5], int (S::*)() volatile&&>()); |
198 | static_assert(!check_equality_comparable_with < int[5], |
199 | int (S::*)() volatile&& noexcept > ()); |
200 | static_assert( |
201 | !check_equality_comparable_with<int[5], int (S::*)() const volatile&&>()); |
202 | static_assert(!check_equality_comparable_with < int[5], |
203 | int (S::*)() const volatile&& noexcept > ()); |
204 | |
205 | static_assert(check_equality_comparable_with<int (*)(), int (*)()>()); |
206 | static_assert(check_equality_comparable_with<int (*)(), int (&)()>()); |
207 | static_assert(!check_equality_comparable_with<int (*)(), int (S::*)()>()); |
208 | static_assert( |
209 | !check_equality_comparable_with<int (*)(), int (S::*)() noexcept>()); |
210 | static_assert(!check_equality_comparable_with<int (*)(), int (S::*)() const>()); |
211 | static_assert( |
212 | !check_equality_comparable_with<int (*)(), int (S::*)() const noexcept>()); |
213 | static_assert( |
214 | !check_equality_comparable_with<int (*)(), int (S::*)() volatile>()); |
215 | static_assert(!check_equality_comparable_with< |
216 | int (*)(), int (S::*)() volatile noexcept>()); |
217 | static_assert( |
218 | !check_equality_comparable_with<int (*)(), int (S::*)() const volatile>()); |
219 | static_assert(!check_equality_comparable_with< |
220 | int (*)(), int (S::*)() const volatile noexcept>()); |
221 | static_assert(!check_equality_comparable_with<int (*)(), int (S::*)() &>()); |
222 | static_assert( |
223 | !check_equality_comparable_with<int (*)(), int (S::*)() & noexcept>()); |
224 | static_assert( |
225 | !check_equality_comparable_with<int (*)(), int (S::*)() const&>()); |
226 | static_assert(!check_equality_comparable_with<int (*)(), |
227 | int (S::*)() const & noexcept>()); |
228 | static_assert( |
229 | !check_equality_comparable_with<int (*)(), int (S::*)() volatile&>()); |
230 | static_assert(!check_equality_comparable_with<int (*)(), int (S::*)() volatile & |
231 | noexcept>()); |
232 | static_assert( |
233 | !check_equality_comparable_with<int (*)(), int (S::*)() const volatile&>()); |
234 | static_assert(!check_equality_comparable_with< |
235 | int (*)(), int (S::*)() const volatile & noexcept>()); |
236 | static_assert(!check_equality_comparable_with<int (*)(), int (S::*)() &&>()); |
237 | static_assert(!check_equality_comparable_with < int (*)(), |
238 | int (S::*)() && noexcept > ()); |
239 | static_assert( |
240 | !check_equality_comparable_with<int (*)(), int (S::*)() const&&>()); |
241 | static_assert(!check_equality_comparable_with < int (*)(), |
242 | int (S::*)() const&& noexcept > ()); |
243 | static_assert( |
244 | !check_equality_comparable_with<int (*)(), int (S::*)() volatile&&>()); |
245 | static_assert(!check_equality_comparable_with < int (*)(), |
246 | int (S::*)() volatile&& noexcept > ()); |
247 | static_assert(!check_equality_comparable_with<int (*)(), |
248 | int (S::*)() const volatile&&>()); |
249 | static_assert(!check_equality_comparable_with < int (*)(), |
250 | int (S::*)() const volatile&& noexcept > ()); |
251 | |
252 | static_assert(check_equality_comparable_with<int (&)(), int (&)()>()); |
253 | static_assert(!check_equality_comparable_with<int (&)(), int (S::*)()>()); |
254 | static_assert( |
255 | !check_equality_comparable_with<int (&)(), int (S::*)() noexcept>()); |
256 | static_assert(!check_equality_comparable_with<int (&)(), int (S::*)() const>()); |
257 | static_assert( |
258 | !check_equality_comparable_with<int (&)(), int (S::*)() const noexcept>()); |
259 | static_assert( |
260 | !check_equality_comparable_with<int (&)(), int (S::*)() volatile>()); |
261 | static_assert(!check_equality_comparable_with< |
262 | int (&)(), int (S::*)() volatile noexcept>()); |
263 | static_assert( |
264 | !check_equality_comparable_with<int (&)(), int (S::*)() const volatile>()); |
265 | static_assert(!check_equality_comparable_with< |
266 | int (&)(), int (S::*)() const volatile noexcept>()); |
267 | static_assert(!check_equality_comparable_with<int (&)(), int (S::*)() &>()); |
268 | static_assert( |
269 | !check_equality_comparable_with<int (&)(), int (S::*)() & noexcept>()); |
270 | static_assert( |
271 | !check_equality_comparable_with<int (&)(), int (S::*)() const&>()); |
272 | static_assert(!check_equality_comparable_with<int (&)(), |
273 | int (S::*)() const & noexcept>()); |
274 | static_assert( |
275 | !check_equality_comparable_with<int (&)(), int (S::*)() volatile&>()); |
276 | static_assert(!check_equality_comparable_with<int (&)(), int (S::*)() volatile & |
277 | noexcept>()); |
278 | static_assert( |
279 | !check_equality_comparable_with<int (&)(), int (S::*)() const volatile&>()); |
280 | static_assert(!check_equality_comparable_with< |
281 | int (&)(), int (S::*)() const volatile & noexcept>()); |
282 | static_assert(!check_equality_comparable_with<int (&)(), int (S::*)() &&>()); |
283 | static_assert(!check_equality_comparable_with < int (&)(), |
284 | int (S::*)() && noexcept > ()); |
285 | static_assert( |
286 | !check_equality_comparable_with<int (&)(), int (S::*)() const&&>()); |
287 | static_assert(!check_equality_comparable_with < int (&)(), |
288 | int (S::*)() const&& noexcept > ()); |
289 | static_assert( |
290 | !check_equality_comparable_with<int (&)(), int (S::*)() volatile&&>()); |
291 | static_assert(!check_equality_comparable_with < int (&)(), |
292 | int (S::*)() volatile&& noexcept > ()); |
293 | static_assert(!check_equality_comparable_with<int (&)(), |
294 | int (S::*)() const volatile&&>()); |
295 | static_assert(!check_equality_comparable_with < int (&)(), |
296 | int (S::*)() const volatile&& noexcept > ()); |
297 | |
298 | static_assert(check_equality_comparable_with<int (S::*)(), int (S::*)()>()); |
299 | static_assert( |
300 | check_equality_comparable_with<int (S::*)(), int (S::*)() noexcept>()); |
301 | static_assert( |
302 | !check_equality_comparable_with<int (S::*)(), int (S::*)() const>()); |
303 | static_assert(!check_equality_comparable_with<int (S::*)(), |
304 | int (S::*)() const noexcept>()); |
305 | static_assert( |
306 | !check_equality_comparable_with<int (S::*)(), int (S::*)() volatile>()); |
307 | static_assert(!check_equality_comparable_with< |
308 | int (S::*)(), int (S::*)() volatile noexcept>()); |
309 | static_assert(!check_equality_comparable_with<int (S::*)(), |
310 | int (S::*)() const volatile>()); |
311 | static_assert(!check_equality_comparable_with< |
312 | int (S::*)(), int (S::*)() const volatile noexcept>()); |
313 | static_assert(!check_equality_comparable_with<int (S::*)(), int (S::*)() &>()); |
314 | static_assert( |
315 | !check_equality_comparable_with<int (S::*)(), int (S::*)() & noexcept>()); |
316 | static_assert( |
317 | !check_equality_comparable_with<int (S::*)(), int (S::*)() const&>()); |
318 | static_assert(!check_equality_comparable_with<int (S::*)(), |
319 | int (S::*)() const & noexcept>()); |
320 | static_assert( |
321 | !check_equality_comparable_with<int (S::*)(), int (S::*)() volatile&>()); |
322 | static_assert(!check_equality_comparable_with< |
323 | int (S::*)(), int (S::*)() volatile & noexcept>()); |
324 | static_assert(!check_equality_comparable_with<int (S::*)(), |
325 | int (S::*)() const volatile&>()); |
326 | static_assert(!check_equality_comparable_with< |
327 | int (S::*)(), int (S::*)() const volatile & noexcept>()); |
328 | static_assert(!check_equality_comparable_with<int (S::*)(), int (S::*)() &&>()); |
329 | static_assert(!check_equality_comparable_with < int (S::*)(), |
330 | int (S::*)() && noexcept > ()); |
331 | static_assert( |
332 | !check_equality_comparable_with<int (S::*)(), int (S::*)() const&&>()); |
333 | static_assert(!check_equality_comparable_with < int (S::*)(), |
334 | int (S::*)() const&& noexcept > ()); |
335 | static_assert( |
336 | !check_equality_comparable_with<int (S::*)(), int (S::*)() volatile&&>()); |
337 | static_assert(!check_equality_comparable_with < int (S::*)(), |
338 | int (S::*)() volatile&& noexcept > ()); |
339 | static_assert(!check_equality_comparable_with<int (S::*)(), |
340 | int (S::*)() const volatile&&>()); |
341 | static_assert(!check_equality_comparable_with < int (S::*)(), |
342 | int (S::*)() const volatile&& noexcept > ()); |
343 | |
344 | static_assert(check_equality_comparable_with<int (S::*)() noexcept, |
345 | int (S::*)() noexcept>()); |
346 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
347 | int (S::*)() const>()); |
348 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
349 | int (S::*)() const noexcept>()); |
350 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
351 | int (S::*)() volatile>()); |
352 | static_assert(!check_equality_comparable_with< |
353 | int (S::*)() noexcept, int (S::*)() volatile noexcept>()); |
354 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
355 | int (S::*)() const volatile>()); |
356 | static_assert(!check_equality_comparable_with< |
357 | int (S::*)() noexcept, int (S::*)() const volatile noexcept>()); |
358 | static_assert( |
359 | !check_equality_comparable_with<int (S::*)() noexcept, int (S::*)() &>()); |
360 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
361 | int (S::*)() & noexcept>()); |
362 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
363 | int (S::*)() const&>()); |
364 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
365 | int (S::*)() const & noexcept>()); |
366 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
367 | int (S::*)() volatile&>()); |
368 | static_assert(!check_equality_comparable_with< |
369 | int (S::*)() noexcept, int (S::*)() volatile & noexcept>()); |
370 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
371 | int (S::*)() const volatile&>()); |
372 | static_assert(!check_equality_comparable_with< |
373 | int (S::*)() noexcept, int (S::*)() const volatile & noexcept>()); |
374 | static_assert( |
375 | !check_equality_comparable_with<int (S::*)() noexcept, int (S::*)() &&>()); |
376 | static_assert(!check_equality_comparable_with < int (S::*)() noexcept, |
377 | int (S::*)() && noexcept > ()); |
378 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
379 | int (S::*)() const&&>()); |
380 | static_assert(!check_equality_comparable_with < int (S::*)() noexcept, |
381 | int (S::*)() const&& noexcept > ()); |
382 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
383 | int (S::*)() volatile&&>()); |
384 | static_assert(!check_equality_comparable_with < int (S::*)() noexcept, |
385 | int (S::*)() volatile&& noexcept > ()); |
386 | static_assert(!check_equality_comparable_with<int (S::*)() noexcept, |
387 | int (S::*)() const volatile&&>()); |
388 | static_assert(!check_equality_comparable_with < int (S::*)() noexcept, |
389 | int (S::*)() const volatile&& noexcept > ()); |
390 | |
391 | static_assert( |
392 | check_equality_comparable_with<int (S::*)() const, int (S::*)() const>()); |
393 | static_assert(check_equality_comparable_with<int (S::*)() const, |
394 | int (S::*)() const noexcept>()); |
395 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
396 | int (S::*)() volatile>()); |
397 | static_assert(!check_equality_comparable_with< |
398 | int (S::*)() const, int (S::*)() volatile noexcept>()); |
399 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
400 | int (S::*)() const volatile>()); |
401 | static_assert(!check_equality_comparable_with< |
402 | int (S::*)() const, int (S::*)() const volatile noexcept>()); |
403 | static_assert( |
404 | !check_equality_comparable_with<int (S::*)() const, int (S::*)() &>()); |
405 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
406 | int (S::*)() & noexcept>()); |
407 | static_assert( |
408 | !check_equality_comparable_with<int (S::*)() const, int (S::*)() const&>()); |
409 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
410 | int (S::*)() const & noexcept>()); |
411 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
412 | int (S::*)() volatile&>()); |
413 | static_assert(!check_equality_comparable_with< |
414 | int (S::*)() const, int (S::*)() volatile & noexcept>()); |
415 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
416 | int (S::*)() const volatile&>()); |
417 | static_assert(!check_equality_comparable_with< |
418 | int (S::*)() const, int (S::*)() const volatile & noexcept>()); |
419 | static_assert( |
420 | !check_equality_comparable_with<int (S::*)() const, int (S::*)() &&>()); |
421 | static_assert(!check_equality_comparable_with < int (S::*)() const, |
422 | int (S::*)() && noexcept > ()); |
423 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
424 | int (S::*)() const&&>()); |
425 | static_assert(!check_equality_comparable_with < int (S::*)() const, |
426 | int (S::*)() const&& noexcept > ()); |
427 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
428 | int (S::*)() volatile&&>()); |
429 | static_assert(!check_equality_comparable_with < int (S::*)() const, |
430 | int (S::*)() volatile&& noexcept > ()); |
431 | static_assert(!check_equality_comparable_with<int (S::*)() const, |
432 | int (S::*)() const volatile&&>()); |
433 | static_assert(!check_equality_comparable_with < int (S::*)() const, |
434 | int (S::*)() const volatile&& noexcept > ()); |
435 | |
436 | static_assert(check_equality_comparable_with<int (S::*)() const noexcept, |
437 | int (S::*)() const noexcept>()); |
438 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
439 | int (S::*)() volatile>()); |
440 | static_assert(!check_equality_comparable_with< |
441 | int (S::*)() const noexcept, int (S::*)() volatile noexcept>()); |
442 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
443 | int (S::*)() const volatile>()); |
444 | static_assert( |
445 | !check_equality_comparable_with<int (S::*)() const noexcept, |
446 | int (S::*)() const volatile noexcept>()); |
447 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
448 | int (S::*)() &>()); |
449 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
450 | int (S::*)() & noexcept>()); |
451 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
452 | int (S::*)() const&>()); |
453 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
454 | int (S::*)() const & noexcept>()); |
455 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
456 | int (S::*)() volatile&>()); |
457 | static_assert(!check_equality_comparable_with< |
458 | int (S::*)() const noexcept, int (S::*)() volatile & noexcept>()); |
459 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
460 | int (S::*)() const volatile&>()); |
461 | static_assert( |
462 | !check_equality_comparable_with<int (S::*)() const noexcept, |
463 | int (S::*)() const volatile & noexcept>()); |
464 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
465 | int (S::*)() &&>()); |
466 | static_assert(!check_equality_comparable_with < int (S::*)() const noexcept, |
467 | int (S::*)() && noexcept > ()); |
468 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
469 | int (S::*)() const&&>()); |
470 | static_assert(!check_equality_comparable_with < int (S::*)() const noexcept, |
471 | int (S::*)() const&& noexcept > ()); |
472 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
473 | int (S::*)() volatile&&>()); |
474 | static_assert(!check_equality_comparable_with < int (S::*)() const noexcept, |
475 | int (S::*)() volatile&& noexcept > ()); |
476 | static_assert(!check_equality_comparable_with<int (S::*)() const noexcept, |
477 | int (S::*)() const volatile&&>()); |
478 | static_assert(!check_equality_comparable_with < int (S::*)() const noexcept, |
479 | int (S::*)() const volatile&& noexcept > ()); |
480 | |
481 | static_assert(check_equality_comparable_with<int (S::*)() volatile, |
482 | int (S::*)() volatile>()); |
483 | static_assert(check_equality_comparable_with<int (S::*)() volatile, |
484 | int (S::*)() volatile noexcept>()); |
485 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
486 | int (S::*)() const volatile>()); |
487 | static_assert(!check_equality_comparable_with< |
488 | int (S::*)() volatile, int (S::*)() const volatile noexcept>()); |
489 | static_assert( |
490 | !check_equality_comparable_with<int (S::*)() volatile, int (S::*)() &>()); |
491 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
492 | int (S::*)() & noexcept>()); |
493 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
494 | int (S::*)() const&>()); |
495 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
496 | int (S::*)() const & noexcept>()); |
497 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
498 | int (S::*)() volatile&>()); |
499 | static_assert(!check_equality_comparable_with< |
500 | int (S::*)() volatile, int (S::*)() volatile & noexcept>()); |
501 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
502 | int (S::*)() const volatile&>()); |
503 | static_assert(!check_equality_comparable_with< |
504 | int (S::*)() volatile, int (S::*)() const volatile & noexcept>()); |
505 | static_assert( |
506 | !check_equality_comparable_with<int (S::*)() volatile, int (S::*)() &&>()); |
507 | static_assert(!check_equality_comparable_with < int (S::*)() volatile, |
508 | int (S::*)() && noexcept > ()); |
509 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
510 | int (S::*)() const&&>()); |
511 | static_assert(!check_equality_comparable_with < int (S::*)() volatile, |
512 | int (S::*)() const&& noexcept > ()); |
513 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
514 | int (S::*)() volatile&&>()); |
515 | static_assert(!check_equality_comparable_with < int (S::*)() volatile, |
516 | int (S::*)() volatile&& noexcept > ()); |
517 | static_assert(!check_equality_comparable_with<int (S::*)() volatile, |
518 | int (S::*)() const volatile&&>()); |
519 | static_assert(!check_equality_comparable_with < int (S::*)() volatile, |
520 | int (S::*)() const volatile&& noexcept > ()); |
521 | |
522 | static_assert(check_equality_comparable_with<int (S::*)() volatile noexcept, |
523 | int (S::*)() volatile noexcept>()); |
524 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
525 | int (S::*)() const volatile>()); |
526 | static_assert( |
527 | !check_equality_comparable_with<int (S::*)() volatile noexcept, |
528 | int (S::*)() const volatile noexcept>()); |
529 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
530 | int (S::*)() &>()); |
531 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
532 | int (S::*)() & noexcept>()); |
533 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
534 | int (S::*)() const&>()); |
535 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
536 | int (S::*)() const & noexcept>()); |
537 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
538 | int (S::*)() volatile&>()); |
539 | static_assert( |
540 | !check_equality_comparable_with<int (S::*)() volatile noexcept, |
541 | int (S::*)() volatile & noexcept>()); |
542 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
543 | int (S::*)() const volatile&>()); |
544 | static_assert( |
545 | !check_equality_comparable_with<int (S::*)() volatile noexcept, |
546 | int (S::*)() const volatile & noexcept>()); |
547 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
548 | int (S::*)() &&>()); |
549 | static_assert(!check_equality_comparable_with < int (S::*)() volatile noexcept, |
550 | int (S::*)() && noexcept > ()); |
551 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
552 | int (S::*)() const&&>()); |
553 | static_assert(!check_equality_comparable_with < int (S::*)() volatile noexcept, |
554 | int (S::*)() const&& noexcept > ()); |
555 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
556 | int (S::*)() volatile&&>()); |
557 | static_assert(!check_equality_comparable_with < int (S::*)() volatile noexcept, |
558 | int (S::*)() volatile&& noexcept > ()); |
559 | static_assert(!check_equality_comparable_with<int (S::*)() volatile noexcept, |
560 | int (S::*)() const volatile&&>()); |
561 | static_assert(!check_equality_comparable_with < int (S::*)() volatile noexcept, |
562 | int (S::*)() const volatile&& noexcept > ()); |
563 | |
564 | static_assert(check_equality_comparable_with<int (S::*)() const volatile, |
565 | int (S::*)() const volatile>()); |
566 | static_assert( |
567 | check_equality_comparable_with<int (S::*)() const volatile, |
568 | int (S::*)() const volatile noexcept>()); |
569 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
570 | int (S::*)() &>()); |
571 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
572 | int (S::*)() & noexcept>()); |
573 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
574 | int (S::*)() const&>()); |
575 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
576 | int (S::*)() const & noexcept>()); |
577 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
578 | int (S::*)() volatile&>()); |
579 | static_assert(!check_equality_comparable_with< |
580 | int (S::*)() const volatile, int (S::*)() volatile & noexcept>()); |
581 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
582 | int (S::*)() const volatile&>()); |
583 | static_assert( |
584 | !check_equality_comparable_with<int (S::*)() const volatile, |
585 | int (S::*)() const volatile & noexcept>()); |
586 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
587 | int (S::*)() &&>()); |
588 | static_assert(!check_equality_comparable_with < int (S::*)() const volatile, |
589 | int (S::*)() && noexcept > ()); |
590 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
591 | int (S::*)() const&&>()); |
592 | static_assert(!check_equality_comparable_with < int (S::*)() const volatile, |
593 | int (S::*)() const&& noexcept > ()); |
594 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
595 | int (S::*)() volatile&&>()); |
596 | static_assert(!check_equality_comparable_with < int (S::*)() const volatile, |
597 | int (S::*)() volatile&& noexcept > ()); |
598 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile, |
599 | int (S::*)() const volatile&&>()); |
600 | static_assert(!check_equality_comparable_with < int (S::*)() const volatile, |
601 | int (S::*)() const volatile&& noexcept > ()); |
602 | |
603 | static_assert( |
604 | check_equality_comparable_with<int (S::*)() const volatile noexcept, |
605 | int (S::*)() const volatile noexcept>()); |
606 | static_assert(!check_equality_comparable_with< |
607 | int (S::*)() const volatile noexcept, int (S::*)() &>()); |
608 | static_assert(!check_equality_comparable_with< |
609 | int (S::*)() const volatile noexcept, int (S::*)() & noexcept>()); |
610 | static_assert(!check_equality_comparable_with< |
611 | int (S::*)() const volatile noexcept, int (S::*)() const&>()); |
612 | static_assert( |
613 | !check_equality_comparable_with<int (S::*)() const volatile noexcept, |
614 | int (S::*)() const & noexcept>()); |
615 | static_assert(!check_equality_comparable_with< |
616 | int (S::*)() const volatile noexcept, int (S::*)() volatile&>()); |
617 | static_assert( |
618 | !check_equality_comparable_with<int (S::*)() const volatile noexcept, |
619 | int (S::*)() volatile & noexcept>()); |
620 | static_assert( |
621 | !check_equality_comparable_with<int (S::*)() const volatile noexcept, |
622 | int (S::*)() const volatile&>()); |
623 | static_assert( |
624 | !check_equality_comparable_with<int (S::*)() const volatile noexcept, |
625 | int (S::*)() const volatile & noexcept>()); |
626 | static_assert(!check_equality_comparable_with< |
627 | int (S::*)() const volatile noexcept, int (S::*)() &&>()); |
628 | static_assert(!check_equality_comparable_with < int (S::*)() |
629 | const volatile noexcept, |
630 | int (S::*)() && noexcept > ()); |
631 | static_assert(!check_equality_comparable_with< |
632 | int (S::*)() const volatile noexcept, int (S::*)() const&&>()); |
633 | static_assert(!check_equality_comparable_with < int (S::*)() |
634 | const volatile noexcept, |
635 | int (S::*)() const&& noexcept > ()); |
636 | static_assert(!check_equality_comparable_with< |
637 | int (S::*)() const volatile noexcept, int (S::*)() volatile&&>()); |
638 | static_assert(!check_equality_comparable_with < int (S::*)() |
639 | const volatile noexcept, |
640 | int (S::*)() volatile&& noexcept > ()); |
641 | static_assert( |
642 | !check_equality_comparable_with<int (S::*)() const volatile noexcept, |
643 | int (S::*)() const volatile&&>()); |
644 | static_assert(!check_equality_comparable_with < int (S::*)() |
645 | const volatile noexcept, |
646 | int (S::*)() const volatile&& noexcept > ()); |
647 | |
648 | static_assert(check_equality_comparable_with<int (S::*)() &, int (S::*)() &>()); |
649 | static_assert( |
650 | check_equality_comparable_with<int (S::*)() &, int (S::*)() & noexcept>()); |
651 | static_assert( |
652 | !check_equality_comparable_with<int (S::*)() &, int (S::*)() const&>()); |
653 | static_assert(!check_equality_comparable_with<int (S::*)() &, |
654 | int (S::*)() const & noexcept>()); |
655 | static_assert( |
656 | !check_equality_comparable_with<int (S::*)() &, int (S::*)() volatile&>()); |
657 | static_assert(!check_equality_comparable_with< |
658 | int (S::*)() &, int (S::*)() volatile & noexcept>()); |
659 | static_assert(!check_equality_comparable_with<int (S::*)() &, |
660 | int (S::*)() const volatile&>()); |
661 | static_assert(!check_equality_comparable_with< |
662 | int (S::*)() &, int (S::*)() const volatile & noexcept>()); |
663 | static_assert( |
664 | !check_equality_comparable_with<int (S::*)() &, int (S::*)() &&>()); |
665 | static_assert(!check_equality_comparable_with < int (S::*)() &, |
666 | int (S::*)() && noexcept > ()); |
667 | static_assert( |
668 | !check_equality_comparable_with<int (S::*)() &, int (S::*)() const&&>()); |
669 | static_assert(!check_equality_comparable_with < int (S::*)() &, |
670 | int (S::*)() const&& noexcept > ()); |
671 | static_assert( |
672 | !check_equality_comparable_with<int (S::*)() &, int (S::*)() volatile&&>()); |
673 | static_assert(!check_equality_comparable_with < int (S::*)() &, |
674 | int (S::*)() volatile&& noexcept > ()); |
675 | static_assert(!check_equality_comparable_with<int (S::*)() &, |
676 | int (S::*)() const volatile&&>()); |
677 | static_assert(!check_equality_comparable_with < int (S::*)() &, |
678 | int (S::*)() const volatile&& noexcept > ()); |
679 | |
680 | static_assert(check_equality_comparable_with<int (S::*)() & noexcept, |
681 | int (S::*)() & noexcept>()); |
682 | static_assert(!check_equality_comparable_with<int (S::*)() & noexcept, |
683 | int (S::*)() const&>()); |
684 | static_assert(!check_equality_comparable_with<int (S::*)() & noexcept, |
685 | int (S::*)() const & noexcept>()); |
686 | static_assert(!check_equality_comparable_with<int (S::*)() & noexcept, |
687 | int (S::*)() volatile&>()); |
688 | static_assert(!check_equality_comparable_with< |
689 | int (S::*)() & noexcept, int (S::*)() volatile & noexcept>()); |
690 | static_assert(!check_equality_comparable_with<int (S::*)() & noexcept, |
691 | int (S::*)() const volatile&>()); |
692 | static_assert( |
693 | !check_equality_comparable_with<int (S::*)() & noexcept, |
694 | int (S::*)() const volatile & noexcept>()); |
695 | static_assert(!check_equality_comparable_with<int (S::*)() & noexcept, |
696 | int (S::*)() &&>()); |
697 | static_assert(!check_equality_comparable_with < int (S::*)() & noexcept, |
698 | int (S::*)() && noexcept > ()); |
699 | static_assert(!check_equality_comparable_with<int (S::*)() & noexcept, |
700 | int (S::*)() const&&>()); |
701 | static_assert(!check_equality_comparable_with < int (S::*)() & noexcept, |
702 | int (S::*)() const&& noexcept > ()); |
703 | static_assert(!check_equality_comparable_with<int (S::*)() & noexcept, |
704 | int (S::*)() volatile&&>()); |
705 | static_assert(!check_equality_comparable_with < int (S::*)() & noexcept, |
706 | int (S::*)() volatile&& noexcept > ()); |
707 | static_assert(!check_equality_comparable_with<int (S::*)() & noexcept, |
708 | int (S::*)() const volatile&&>()); |
709 | static_assert(!check_equality_comparable_with < int (S::*)() & noexcept, |
710 | int (S::*)() const volatile&& noexcept > ()); |
711 | |
712 | static_assert( |
713 | check_equality_comparable_with<int (S::*)() const&, int (S::*)() const&>()); |
714 | static_assert(check_equality_comparable_with<int (S::*)() const&, |
715 | int (S::*)() const & noexcept>()); |
716 | static_assert(!check_equality_comparable_with<int (S::*)() const&, |
717 | int (S::*)() volatile&>()); |
718 | static_assert(!check_equality_comparable_with< |
719 | int (S::*)() const&, int (S::*)() volatile & noexcept>()); |
720 | static_assert(!check_equality_comparable_with<int (S::*)() const&, |
721 | int (S::*)() const volatile&>()); |
722 | static_assert(!check_equality_comparable_with< |
723 | int (S::*)() const&, int (S::*)() const volatile & noexcept>()); |
724 | static_assert( |
725 | !check_equality_comparable_with<int (S::*)() const&, int (S::*)() &&>()); |
726 | static_assert(!check_equality_comparable_with < int (S::*)() const&, |
727 | int (S::*)() && noexcept > ()); |
728 | static_assert(!check_equality_comparable_with<int (S::*)() const&, |
729 | int (S::*)() const&&>()); |
730 | static_assert(!check_equality_comparable_with < int (S::*)() const&, |
731 | int (S::*)() const&& noexcept > ()); |
732 | static_assert(!check_equality_comparable_with<int (S::*)() const&, |
733 | int (S::*)() volatile&&>()); |
734 | static_assert(!check_equality_comparable_with < int (S::*)() const&, |
735 | int (S::*)() volatile&& noexcept > ()); |
736 | static_assert(!check_equality_comparable_with<int (S::*)() const&, |
737 | int (S::*)() const volatile&&>()); |
738 | static_assert(!check_equality_comparable_with < int (S::*)() const&, |
739 | int (S::*)() const volatile&& noexcept > ()); |
740 | |
741 | static_assert(check_equality_comparable_with<int (S::*)() const & noexcept, |
742 | int (S::*)() const & noexcept>()); |
743 | static_assert(!check_equality_comparable_with<int (S::*)() const & noexcept, |
744 | int (S::*)() volatile&>()); |
745 | static_assert( |
746 | !check_equality_comparable_with<int (S::*)() const & noexcept, |
747 | int (S::*)() volatile & noexcept>()); |
748 | static_assert(!check_equality_comparable_with<int (S::*)() const & noexcept, |
749 | int (S::*)() const volatile&>()); |
750 | static_assert( |
751 | !check_equality_comparable_with<int (S::*)() const & noexcept, |
752 | int (S::*)() const volatile & noexcept>()); |
753 | static_assert(!check_equality_comparable_with<int (S::*)() const & noexcept, |
754 | int (S::*)() &&>()); |
755 | static_assert(!check_equality_comparable_with < int (S::*)() const& noexcept, |
756 | int (S::*)() && noexcept > ()); |
757 | static_assert(!check_equality_comparable_with<int (S::*)() const & noexcept, |
758 | int (S::*)() const&&>()); |
759 | static_assert(!check_equality_comparable_with < int (S::*)() const& noexcept, |
760 | int (S::*)() const&& noexcept > ()); |
761 | static_assert(!check_equality_comparable_with<int (S::*)() const & noexcept, |
762 | int (S::*)() volatile&&>()); |
763 | static_assert(!check_equality_comparable_with < int (S::*)() const& noexcept, |
764 | int (S::*)() volatile&& noexcept > ()); |
765 | static_assert(!check_equality_comparable_with<int (S::*)() const & noexcept, |
766 | int (S::*)() const volatile&&>()); |
767 | static_assert(!check_equality_comparable_with < int (S::*)() const& noexcept, |
768 | int (S::*)() const volatile&& noexcept > ()); |
769 | |
770 | static_assert(check_equality_comparable_with<int (S::*)() volatile&, |
771 | int (S::*)() volatile&>()); |
772 | static_assert(check_equality_comparable_with< |
773 | int (S::*)() volatile&, int (S::*)() volatile & noexcept>()); |
774 | static_assert(!check_equality_comparable_with<int (S::*)() volatile&, |
775 | int (S::*)() const volatile&>()); |
776 | static_assert( |
777 | !check_equality_comparable_with<int (S::*)() volatile&, |
778 | int (S::*)() const volatile & noexcept>()); |
779 | static_assert( |
780 | !check_equality_comparable_with<int (S::*)() volatile&, int (S::*)() &&>()); |
781 | static_assert(!check_equality_comparable_with < int (S::*)() volatile&, |
782 | int (S::*)() && noexcept > ()); |
783 | static_assert(!check_equality_comparable_with<int (S::*)() volatile&, |
784 | int (S::*)() const&&>()); |
785 | static_assert(!check_equality_comparable_with < int (S::*)() volatile&, |
786 | int (S::*)() const&& noexcept > ()); |
787 | static_assert(!check_equality_comparable_with<int (S::*)() volatile&, |
788 | int (S::*)() volatile&&>()); |
789 | static_assert(!check_equality_comparable_with < int (S::*)() volatile&, |
790 | int (S::*)() volatile&& noexcept > ()); |
791 | static_assert(!check_equality_comparable_with<int (S::*)() volatile&, |
792 | int (S::*)() const volatile&&>()); |
793 | static_assert(!check_equality_comparable_with < int (S::*)() volatile&, |
794 | int (S::*)() const volatile&& noexcept > ()); |
795 | |
796 | static_assert( |
797 | check_equality_comparable_with<int (S::*)() volatile & noexcept, |
798 | int (S::*)() volatile & noexcept>()); |
799 | static_assert(!check_equality_comparable_with<int (S::*)() volatile & noexcept, |
800 | int (S::*)() const volatile&>()); |
801 | static_assert( |
802 | !check_equality_comparable_with<int (S::*)() volatile & noexcept, |
803 | int (S::*)() const volatile & noexcept>()); |
804 | static_assert(!check_equality_comparable_with<int (S::*)() volatile & noexcept, |
805 | int (S::*)() &&>()); |
806 | static_assert(!check_equality_comparable_with < int (S::*)() volatile& noexcept, |
807 | int (S::*)() && noexcept > ()); |
808 | static_assert(!check_equality_comparable_with<int (S::*)() volatile & noexcept, |
809 | int (S::*)() const&&>()); |
810 | static_assert(!check_equality_comparable_with < int (S::*)() volatile& noexcept, |
811 | int (S::*)() const&& noexcept > ()); |
812 | static_assert(!check_equality_comparable_with<int (S::*)() volatile & noexcept, |
813 | int (S::*)() volatile&&>()); |
814 | static_assert(!check_equality_comparable_with < int (S::*)() volatile& noexcept, |
815 | int (S::*)() volatile&& noexcept > ()); |
816 | static_assert(!check_equality_comparable_with<int (S::*)() volatile & noexcept, |
817 | int (S::*)() const volatile&&>()); |
818 | static_assert(!check_equality_comparable_with < int (S::*)() volatile& noexcept, |
819 | int (S::*)() const volatile&& noexcept > ()); |
820 | |
821 | static_assert(check_equality_comparable_with<int (S::*)() const volatile&, |
822 | int (S::*)() const volatile&>()); |
823 | static_assert( |
824 | check_equality_comparable_with<int (S::*)() const volatile&, |
825 | int (S::*)() const volatile & noexcept>()); |
826 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile&, |
827 | int (S::*)() &&>()); |
828 | static_assert(!check_equality_comparable_with < int (S::*)() const volatile&, |
829 | int (S::*)() && noexcept > ()); |
830 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile&, |
831 | int (S::*)() const&&>()); |
832 | static_assert(!check_equality_comparable_with < int (S::*)() const volatile&, |
833 | int (S::*)() const&& noexcept > ()); |
834 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile&, |
835 | int (S::*)() volatile&&>()); |
836 | static_assert(!check_equality_comparable_with < int (S::*)() const volatile&, |
837 | int (S::*)() volatile&& noexcept > ()); |
838 | static_assert(!check_equality_comparable_with<int (S::*)() const volatile&, |
839 | int (S::*)() const volatile&&>()); |
840 | static_assert(!check_equality_comparable_with < int (S::*)() const volatile&, |
841 | int (S::*)() const volatile&& noexcept > ()); |
842 | |
843 | static_assert( |
844 | check_equality_comparable_with<int (S::*)() const volatile & noexcept, |
845 | int (S::*)() const volatile & noexcept>()); |
846 | static_assert(!check_equality_comparable_with< |
847 | int (S::*)() const volatile & noexcept, int (S::*)() &&>()); |
848 | static_assert(!check_equality_comparable_with < int (S::*)() |
849 | const volatile& noexcept, |
850 | int (S::*)() && noexcept > ()); |
851 | static_assert(!check_equality_comparable_with< |
852 | int (S::*)() const volatile & noexcept, int (S::*)() const&&>()); |
853 | static_assert(!check_equality_comparable_with < int (S::*)() |
854 | const volatile& noexcept, |
855 | int (S::*)() const&& noexcept > ()); |
856 | static_assert( |
857 | !check_equality_comparable_with<int (S::*)() const volatile & noexcept, |
858 | int (S::*)() volatile&&>()); |
859 | static_assert(!check_equality_comparable_with < int (S::*)() |
860 | const volatile& noexcept, |
861 | int (S::*)() volatile&& noexcept > ()); |
862 | static_assert( |
863 | !check_equality_comparable_with<int (S::*)() const volatile & noexcept, |
864 | int (S::*)() const volatile&&>()); |
865 | static_assert(!check_equality_comparable_with < int (S::*)() |
866 | const volatile& noexcept, |
867 | int (S::*)() const volatile&& noexcept > ()); |
868 | |
869 | static_assert( |
870 | check_equality_comparable_with<int (S::*)() &&, int (S::*)() &&>()); |
871 | static_assert(check_equality_comparable_with<int (S::*)() &&, |
872 | int (S::*)() && noexcept>()); |
873 | static_assert( |
874 | !check_equality_comparable_with<int (S::*)() &&, int (S::*)() const&&>()); |
875 | static_assert(!check_equality_comparable_with < int (S::*)() &&, |
876 | int (S::*)() const&& noexcept > ()); |
877 | static_assert(!check_equality_comparable_with<int (S::*)() &&, |
878 | int (S::*)() volatile&&>()); |
879 | static_assert(!check_equality_comparable_with < int (S::*)() &&, |
880 | int (S::*)() volatile&& noexcept > ()); |
881 | static_assert(!check_equality_comparable_with<int (S::*)() &&, |
882 | int (S::*)() const volatile&&>()); |
883 | static_assert(!check_equality_comparable_with < int (S::*)() &&, |
884 | int (S::*)() const volatile&& noexcept > ()); |
885 | |
886 | static_assert(check_equality_comparable_with<int (S::*)() && noexcept, |
887 | int (S::*)() && noexcept>()); |
888 | static_assert(!check_equality_comparable_with < int (S::*)() && noexcept, |
889 | int (S::*)() const&& > ()); |
890 | static_assert(!check_equality_comparable_with < int (S::*)() && noexcept, |
891 | int (S::*)() const&& noexcept > ()); |
892 | static_assert(!check_equality_comparable_with < int (S::*)() && noexcept, |
893 | int (S::*)() volatile&& > ()); |
894 | static_assert(!check_equality_comparable_with < int (S::*)() && noexcept, |
895 | int (S::*)() volatile&& noexcept > ()); |
896 | static_assert(!check_equality_comparable_with < int (S::*)() && noexcept, |
897 | int (S::*)() const volatile&& > ()); |
898 | static_assert(!check_equality_comparable_with < int (S::*)() && noexcept, |
899 | int (S::*)() const volatile&& noexcept > ()); |
900 | |
901 | static_assert(check_equality_comparable_with<int (S::*)() const&&, |
902 | int (S::*)() const&&>()); |
903 | static_assert(check_equality_comparable_with<int (S::*)() const&&, |
904 | int (S::*)() const && noexcept>()); |
905 | static_assert(!check_equality_comparable_with<int (S::*)() const&&, |
906 | int (S::*)() volatile&&>()); |
907 | static_assert(!check_equality_comparable_with < int (S::*)() const&&, |
908 | int (S::*)() volatile&& noexcept > ()); |
909 | static_assert(!check_equality_comparable_with<int (S::*)() const&&, |
910 | int (S::*)() const volatile&&>()); |
911 | static_assert(!check_equality_comparable_with < int (S::*)() const&&, |
912 | int (S::*)() const volatile&& noexcept > ()); |
913 | |
914 | static_assert(check_equality_comparable_with<int (S::*)() const && noexcept, |
915 | int (S::*)() const && noexcept>()); |
916 | static_assert(!check_equality_comparable_with < int (S::*)() const&& noexcept, |
917 | int (S::*)() volatile&& > ()); |
918 | static_assert(!check_equality_comparable_with < int (S::*)() const&& noexcept, |
919 | int (S::*)() volatile&& noexcept > ()); |
920 | static_assert(!check_equality_comparable_with < int (S::*)() const&& noexcept, |
921 | int (S::*)() const volatile&& > ()); |
922 | static_assert(!check_equality_comparable_with < int (S::*)() const&& noexcept, |
923 | int (S::*)() const volatile&& noexcept > ()); |
924 | |
925 | static_assert(check_equality_comparable_with<int (S::*)() volatile&&, |
926 | int (S::*)() volatile&&>()); |
927 | static_assert(check_equality_comparable_with< |
928 | int (S::*)() volatile&&, int (S::*)() volatile && noexcept>()); |
929 | static_assert(!check_equality_comparable_with<int (S::*)() volatile&&, |
930 | int (S::*)() const volatile&&>()); |
931 | static_assert(!check_equality_comparable_with < int (S::*)() volatile&&, |
932 | int (S::*)() const volatile&& noexcept > ()); |
933 | |
934 | static_assert( |
935 | check_equality_comparable_with<int (S::*)() volatile && noexcept, |
936 | int (S::*)() volatile && noexcept>()); |
937 | static_assert(!check_equality_comparable_with < |
938 | int (S::*)() volatile&& noexcept, |
939 | int (S::*)() const volatile&& > ()); |
940 | static_assert(!check_equality_comparable_with < |
941 | int (S::*)() volatile&& noexcept, |
942 | int (S::*)() const volatile&& noexcept > ()); |
943 | |
944 | static_assert(check_equality_comparable_with<int (S::*)() const volatile&&, |
945 | int (S::*)() const volatile&&>()); |
946 | static_assert( |
947 | check_equality_comparable_with<int (S::*)() const volatile&&, |
948 | int (S::*)() const volatile && noexcept>()); |
949 | static_assert( |
950 | check_equality_comparable_with<int (S::*)() const volatile && noexcept, |
951 | int (S::*)() const volatile && noexcept>()); |
952 | |
953 | static_assert(!check_equality_comparable_with<std::nullptr_t, int>()); |
954 | static_assert(check_equality_comparable_with<std::nullptr_t, int*>()); |
955 | // Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet. |
956 | #if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG) |
957 | static_assert(check_equality_comparable_with<std::nullptr_t, int[5]>()); |
958 | #else |
959 | static_assert(!check_equality_comparable_with<std::nullptr_t, int[5]>()); |
960 | #endif |
961 | static_assert(check_equality_comparable_with<std::nullptr_t, int (*)()>()); |
962 | static_assert(check_equality_comparable_with<std::nullptr_t, int (&)()>()); |
963 | static_assert(check_equality_comparable_with<std::nullptr_t, int (S::*)()>()); |
964 | static_assert( |
965 | check_equality_comparable_with<std::nullptr_t, int (S::*)() noexcept>()); |
966 | static_assert( |
967 | check_equality_comparable_with<std::nullptr_t, int (S::*)() const>()); |
968 | static_assert(check_equality_comparable_with<std::nullptr_t, |
969 | int (S::*)() const noexcept>()); |
970 | static_assert( |
971 | check_equality_comparable_with<std::nullptr_t, int (S::*)() volatile>()); |
972 | static_assert(check_equality_comparable_with<std::nullptr_t, |
973 | int (S::*)() volatile noexcept>()); |
974 | static_assert(check_equality_comparable_with<std::nullptr_t, |
975 | int (S::*)() const volatile>()); |
976 | static_assert(check_equality_comparable_with< |
977 | std::nullptr_t, int (S::*)() const volatile noexcept>()); |
978 | static_assert(check_equality_comparable_with<std::nullptr_t, int (S::*)() &>()); |
979 | static_assert( |
980 | check_equality_comparable_with<std::nullptr_t, int (S::*)() & noexcept>()); |
981 | static_assert( |
982 | check_equality_comparable_with<std::nullptr_t, int (S::*)() const&>()); |
983 | static_assert(check_equality_comparable_with<std::nullptr_t, |
984 | int (S::*)() const & noexcept>()); |
985 | static_assert( |
986 | check_equality_comparable_with<std::nullptr_t, int (S::*)() volatile&>()); |
987 | static_assert(check_equality_comparable_with< |
988 | std::nullptr_t, int (S::*)() volatile & noexcept>()); |
989 | static_assert(check_equality_comparable_with<std::nullptr_t, |
990 | int (S::*)() const volatile&>()); |
991 | static_assert(check_equality_comparable_with< |
992 | std::nullptr_t, int (S::*)() const volatile & noexcept>()); |
993 | static_assert( |
994 | check_equality_comparable_with<std::nullptr_t, int (S::*)() &&>()); |
995 | static_assert( |
996 | check_equality_comparable_with<std::nullptr_t, int (S::*)() && noexcept>()); |
997 | static_assert( |
998 | check_equality_comparable_with<std::nullptr_t, int (S::*)() const&&>()); |
999 | static_assert(check_equality_comparable_with<std::nullptr_t, |
1000 | int (S::*)() const && noexcept>()); |
1001 | static_assert( |
1002 | check_equality_comparable_with<std::nullptr_t, int (S::*)() volatile&&>()); |
1003 | static_assert(check_equality_comparable_with< |
1004 | std::nullptr_t, int (S::*)() volatile && noexcept>()); |
1005 | static_assert(check_equality_comparable_with<std::nullptr_t, |
1006 | int (S::*)() const volatile&&>()); |
1007 | static_assert(check_equality_comparable_with< |
1008 | std::nullptr_t, int (S::*)() const volatile && noexcept>()); |
1009 | |
1010 | static_assert(!std::equality_comparable_with<void, int>); |
1011 | static_assert(!std::equality_comparable_with<void, int*>); |
1012 | static_assert(!std::equality_comparable_with<void, std::nullptr_t>); |
1013 | static_assert(!std::equality_comparable_with<void, int[5]>); |
1014 | static_assert(!std::equality_comparable_with<void, int (*)()>); |
1015 | static_assert(!std::equality_comparable_with<void, int (&)()>); |
1016 | static_assert(!std::equality_comparable_with<void, int S::*>); |
1017 | static_assert(!std::equality_comparable_with<void, int (S::*)()>); |
1018 | static_assert(!std::equality_comparable_with<void, int (S::*)() noexcept>); |
1019 | static_assert(!std::equality_comparable_with<void, int (S::*)() const>); |
1020 | static_assert( |
1021 | !std::equality_comparable_with<void, int (S::*)() const noexcept>); |
1022 | static_assert(!std::equality_comparable_with<void, int (S::*)() volatile>); |
1023 | static_assert( |
1024 | !std::equality_comparable_with<void, int (S::*)() volatile noexcept>); |
1025 | static_assert( |
1026 | !std::equality_comparable_with<void, int (S::*)() const volatile>); |
1027 | static_assert( |
1028 | !std::equality_comparable_with<void, int (S::*)() const volatile noexcept>); |
1029 | static_assert(!std::equality_comparable_with<void, int (S::*)() &>); |
1030 | static_assert(!std::equality_comparable_with<void, int (S::*)() & noexcept>); |
1031 | static_assert(!std::equality_comparable_with<void, int (S::*)() const&>); |
1032 | static_assert( |
1033 | !std::equality_comparable_with<void, int (S::*)() const & noexcept>); |
1034 | static_assert(!std::equality_comparable_with<void, int (S::*)() volatile&>); |
1035 | static_assert( |
1036 | !std::equality_comparable_with<void, int (S::*)() volatile & noexcept>); |
1037 | static_assert( |
1038 | !std::equality_comparable_with<void, int (S::*)() const volatile&>); |
1039 | static_assert(!std::equality_comparable_with<void, int (S::*)() const volatile & |
1040 | noexcept>); |
1041 | static_assert(!std::equality_comparable_with<void, int (S::*)() &&>); |
1042 | static_assert(!std::equality_comparable_with < void, |
1043 | int (S::*)() && noexcept >); |
1044 | static_assert(!std::equality_comparable_with<void, int (S::*)() const&&>); |
1045 | static_assert(!std::equality_comparable_with < void, |
1046 | int (S::*)() const&& noexcept >); |
1047 | static_assert(!std::equality_comparable_with<void, int (S::*)() volatile&&>); |
1048 | static_assert(!std::equality_comparable_with < void, |
1049 | int (S::*)() volatile&& noexcept >); |
1050 | static_assert( |
1051 | !std::equality_comparable_with<void, int (S::*)() const volatile&&>); |
1052 | static_assert(!std::equality_comparable_with < void, |
1053 | int (S::*)() const volatile&& noexcept >); |
1054 | } // namespace fundamentals |
1055 | |
1056 | namespace standard_types { |
1057 | static_assert(check_equality_comparable_with<std::array<int, 10>, |
1058 | std::array<int, 10> >()); |
1059 | static_assert(!check_equality_comparable_with<std::array<int, 10>, |
1060 | std::array<double, 10> >()); |
1061 | static_assert( |
1062 | check_equality_comparable_with<std::deque<int>, std::deque<int> >()); |
1063 | static_assert( |
1064 | !check_equality_comparable_with<std::deque<int>, std::vector<int> >()); |
1065 | static_assert(check_equality_comparable_with<std::forward_list<int>, |
1066 | std::forward_list<int> >()); |
1067 | static_assert(!check_equality_comparable_with<std::forward_list<int>, |
1068 | std::vector<int> >()); |
1069 | static_assert( |
1070 | check_equality_comparable_with<std::list<int>, std::list<int> >()); |
1071 | static_assert( |
1072 | !check_equality_comparable_with<std::list<int>, std::vector<int> >()); |
1073 | |
1074 | #ifndef TEST_HAS_NO_THREADS |
1075 | static_assert(!check_equality_comparable_with<std::lock_guard<std::mutex>, |
1076 | std::lock_guard<std::mutex> >()); |
1077 | static_assert(!check_equality_comparable_with<std::lock_guard<std::mutex>, |
1078 | std::vector<int> >()); |
1079 | static_assert(!check_equality_comparable_with<std::mutex, std::mutex>()); |
1080 | static_assert(!check_equality_comparable_with<std::mutex, std::vector<int> >()); |
1081 | #endif |
1082 | |
1083 | static_assert(check_equality_comparable_with<std::map<int, void*>, |
1084 | std::map<int, void*> >()); |
1085 | static_assert( |
1086 | !check_equality_comparable_with<std::map<int, void*>, std::vector<int> >()); |
1087 | static_assert( |
1088 | check_equality_comparable_with<std::optional<std::vector<int> >, |
1089 | std::optional<std::vector<int> > >()); |
1090 | static_assert(check_equality_comparable_with<std::optional<std::vector<int> >, |
1091 | std::vector<int> >()); |
1092 | static_assert( |
1093 | check_equality_comparable_with<std::vector<int>, std::vector<int> >()); |
1094 | static_assert(!check_equality_comparable_with<std::vector<int>, int>()); |
1095 | } // namespace standard_types |
1096 | |
1097 | namespace types_fit_for_purpose { |
1098 | static_assert( |
1099 | check_equality_comparable_with<cxx20_member_eq, cxx20_member_eq>()); |
1100 | static_assert( |
1101 | check_equality_comparable_with<cxx20_friend_eq, cxx20_friend_eq>()); |
1102 | static_assert( |
1103 | !check_equality_comparable_with<cxx20_member_eq, cxx20_friend_eq>()); |
1104 | |
1105 | static_assert(check_equality_comparable_with<member_three_way_comparable, |
1106 | member_three_way_comparable>()); |
1107 | static_assert(check_equality_comparable_with<friend_three_way_comparable, |
1108 | friend_three_way_comparable>()); |
1109 | static_assert(!check_equality_comparable_with<member_three_way_comparable, |
1110 | friend_three_way_comparable>()); |
1111 | |
1112 | static_assert( |
1113 | check_equality_comparable_with<explicit_operators, explicit_operators>()); |
1114 | static_assert(check_equality_comparable_with<equality_comparable_with_ec1, |
1115 | equality_comparable_with_ec1>()); |
1116 | static_assert(check_equality_comparable_with<different_return_types, |
1117 | different_return_types>()); |
1118 | static_assert(check_equality_comparable_with<explicit_operators, |
1119 | equality_comparable_with_ec1>()); |
1120 | static_assert(check_equality_comparable_with<explicit_operators, |
1121 | different_return_types>()); |
1122 | |
1123 | static_assert(check_equality_comparable_with<one_way_eq, one_way_eq>()); |
1124 | static_assert( |
1125 | std::common_reference_with<one_way_eq const&, explicit_operators const&>); |
1126 | static_assert( |
1127 | !check_equality_comparable_with<one_way_eq, explicit_operators>()); |
1128 | |
1129 | static_assert(check_equality_comparable_with<one_way_ne, one_way_ne>()); |
1130 | static_assert( |
1131 | std::common_reference_with<one_way_ne const&, explicit_operators const&>); |
1132 | static_assert( |
1133 | !check_equality_comparable_with<one_way_ne, explicit_operators>()); |
1134 | } // namespace types_fit_for_purpose |
1135 | |