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

source code of libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered_with.pass.cpp