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

source code of libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp