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 <cstddef>
18#include <deque>
19#include <forward_list>
20#include <list>
21#include <map>
22#include <optional>
23#include <vector>
24
25#include "compare_types.h"
26#include "test_macros.h"
27
28template <class T, class U>
29constexpr bool check_totally_ordered_with() noexcept {
30 constexpr bool result = std::totally_ordered_with<T, U>;
31 static_assert(std::totally_ordered_with<U, T> == result);
32 static_assert(std::totally_ordered_with<T, U const> == result);
33 static_assert(std::totally_ordered_with<T const, U const> == result);
34 static_assert(std::totally_ordered_with<T, U const&> == result);
35 static_assert(std::totally_ordered_with<T const, U const&> == result);
36 static_assert(std::totally_ordered_with<T&, U const> == result);
37 static_assert(std::totally_ordered_with<T const&, U const> == result);
38 static_assert(std::totally_ordered_with<T&, U const&> == result);
39 static_assert(std::totally_ordered_with<T const&, U const&> == result);
40 static_assert(std::totally_ordered_with<T, U const&&> == result);
41 static_assert(std::totally_ordered_with<T const, U const&&> == result);
42 static_assert(std::totally_ordered_with<T&, U const&&> == result);
43 static_assert(std::totally_ordered_with<T const&, U const&&> == result);
44 static_assert(std::totally_ordered_with<T&&, U const> == result);
45 static_assert(std::totally_ordered_with<T const&&, U const> == result);
46 static_assert(std::totally_ordered_with<T&&, U const&> == result);
47 static_assert(std::totally_ordered_with<T const&&, U const&> == result);
48 static_assert(std::totally_ordered_with<T&&, U const&&> == result);
49 static_assert(std::totally_ordered_with<T const&&, U const&&> == result);
50 return result;
51}
52
53namespace fundamentals {
54static_assert(check_totally_ordered_with<int, int>());
55static_assert(check_totally_ordered_with<int, bool>());
56static_assert(check_totally_ordered_with<int, char>());
57static_assert(check_totally_ordered_with<int, wchar_t>());
58static_assert(check_totally_ordered_with<int, double>());
59static_assert(!check_totally_ordered_with<int, int*>());
60static_assert(!check_totally_ordered_with<int, int[5]>());
61static_assert(!check_totally_ordered_with<int, int (*)()>());
62static_assert(!check_totally_ordered_with<int, int (&)()>());
63
64struct S {};
65static_assert(!check_totally_ordered_with<int, int S::*>());
66static_assert(!check_totally_ordered_with<int, int (S::*)()>());
67static_assert(!check_totally_ordered_with<int, int (S::*)() noexcept>());
68static_assert(!check_totally_ordered_with<int, int (S::*)() const>());
69static_assert(!check_totally_ordered_with<int, int (S::*)() const noexcept>());
70static_assert(!check_totally_ordered_with<int, int (S::*)() volatile>());
71static_assert(!check_totally_ordered_with<int, int (S::*)() volatile noexcept>());
72static_assert(!check_totally_ordered_with<int, int (S::*)() const volatile>());
73static_assert(!check_totally_ordered_with<int, int (S::*)() const volatile noexcept>());
74static_assert(!check_totally_ordered_with<int, int (S::*)() &>());
75static_assert(!check_totally_ordered_with<int, int (S::*)() & noexcept>());
76static_assert(!check_totally_ordered_with<int, int (S::*)() const&>());
77static_assert(!check_totally_ordered_with<int, int (S::*)() const & noexcept>());
78static_assert(!check_totally_ordered_with<int, int (S::*)() volatile&>());
79static_assert(!check_totally_ordered_with<int, int (S::*)() volatile & noexcept>());
80static_assert(!check_totally_ordered_with<int, int (S::*)() const volatile&>());
81static_assert(!check_totally_ordered_with<int, int (S::*)() const volatile & noexcept>());
82static_assert(!check_totally_ordered_with<int, int (S::*)() &&>());
83static_assert(!check_totally_ordered_with < int, int (S::*)() && noexcept > ());
84static_assert(!check_totally_ordered_with<int, int (S::*)() const&&>());
85static_assert(!check_totally_ordered_with < int, int (S::*)() const&& noexcept > ());
86static_assert(!check_totally_ordered_with<int, int (S::*)() volatile&&>());
87static_assert(!check_totally_ordered_with < int, int (S::*)() volatile&& noexcept > ());
88static_assert(!check_totally_ordered_with<int, int (S::*)() const volatile&&>());
89static_assert(!check_totally_ordered_with < int, int (S::*)() const volatile&& noexcept > ());
90
91static_assert(check_totally_ordered_with<int*, int*>());
92// Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet.
93#if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG)
94static_assert(check_totally_ordered_with<int*, int[5]>());
95#else
96static_assert(!check_totally_ordered_with<int*, int[5]>());
97#endif
98static_assert(!check_totally_ordered_with<int*, int (*)()>());
99static_assert(!check_totally_ordered_with<int*, int (&)()>());
100static_assert(!check_totally_ordered_with<int*, int (S::*)()>());
101static_assert(!check_totally_ordered_with<int*, int (S::*)() noexcept>());
102static_assert(!check_totally_ordered_with<int*, int (S::*)() const>());
103static_assert(!check_totally_ordered_with<int*, int (S::*)() const noexcept>());
104static_assert(!check_totally_ordered_with<int*, int (S::*)() volatile>());
105static_assert(!check_totally_ordered_with<int*, int (S::*)() volatile noexcept>());
106static_assert(!check_totally_ordered_with<int*, int (S::*)() const volatile>());
107static_assert(!check_totally_ordered_with<int*, int (S::*)() const volatile noexcept>());
108static_assert(!check_totally_ordered_with<int*, int (S::*)() &>());
109static_assert(!check_totally_ordered_with<int*, int (S::*)() & noexcept>());
110static_assert(!check_totally_ordered_with<int*, int (S::*)() const&>());
111static_assert(!check_totally_ordered_with<int*, int (S::*)() const & noexcept>());
112static_assert(!check_totally_ordered_with<int*, int (S::*)() volatile&>());
113static_assert(!check_totally_ordered_with<int*, int (S::*)() volatile & noexcept>());
114static_assert(!check_totally_ordered_with<int*, int (S::*)() const volatile&>());
115static_assert(!check_totally_ordered_with<int*, int (S::*)() const volatile & noexcept>());
116static_assert(!check_totally_ordered_with<int*, int (S::*)() &&>());
117static_assert(!check_totally_ordered_with < int*, int (S::*)() && noexcept > ());
118static_assert(!check_totally_ordered_with<int*, int (S::*)() const&&>());
119static_assert(!check_totally_ordered_with < int*, int (S::*)() const&& noexcept > ());
120static_assert(!check_totally_ordered_with<int*, int (S::*)() volatile&&>());
121static_assert(!check_totally_ordered_with < int*, int (S::*)() volatile&& noexcept > ());
122static_assert(!check_totally_ordered_with<int*, int (S::*)() const volatile&&>());
123static_assert(!check_totally_ordered_with < int*, int (S::*)() const volatile&& noexcept > ());
124
125// Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet.
126#if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG)
127static_assert(check_totally_ordered_with<int[5], int[5]>());
128#else
129static_assert(!check_totally_ordered_with<int[5], int[5]>());
130#endif
131static_assert(!check_totally_ordered_with<int[5], int (*)()>());
132static_assert(!check_totally_ordered_with<int[5], int (&)()>());
133static_assert(!check_totally_ordered_with<int[5], int (S::*)()>());
134static_assert(!check_totally_ordered_with<int[5], int (S::*)() noexcept>());
135static_assert(!check_totally_ordered_with<int[5], int (S::*)() const>());
136static_assert(!check_totally_ordered_with<int[5], int (S::*)() const noexcept>());
137static_assert(!check_totally_ordered_with<int[5], int (S::*)() volatile>());
138static_assert(!check_totally_ordered_with<int[5], int (S::*)() volatile noexcept>());
139static_assert(!check_totally_ordered_with<int[5], int (S::*)() const volatile>());
140static_assert(!check_totally_ordered_with< int[5], int (S::*)() const volatile noexcept>());
141static_assert(!check_totally_ordered_with<int[5], int (S::*)() &>());
142static_assert(!check_totally_ordered_with<int[5], int (S::*)() & noexcept>());
143static_assert(!check_totally_ordered_with<int[5], int (S::*)() const&>());
144static_assert(!check_totally_ordered_with<int[5], int (S::*)() const & noexcept>());
145static_assert(!check_totally_ordered_with<int[5], int (S::*)() volatile&>());
146static_assert(!check_totally_ordered_with<int[5], int (S::*)() volatile & noexcept>());
147static_assert(!check_totally_ordered_with<int[5], int (S::*)() const volatile&>());
148static_assert(!check_totally_ordered_with<int[5], int (S::*)() const volatile & noexcept>());
149static_assert(!check_totally_ordered_with<int[5], int (S::*)() &&>());
150static_assert(!check_totally_ordered_with < int[5], int (S::*)() && noexcept > ());
151static_assert(!check_totally_ordered_with<int[5], int (S::*)() const&&>());
152static_assert(!check_totally_ordered_with < int[5], int (S::*)() const&& noexcept > ());
153static_assert(!check_totally_ordered_with<int[5], int (S::*)() volatile&&>());
154static_assert(!check_totally_ordered_with < int[5], int (S::*)() volatile&& noexcept > ());
155static_assert(!check_totally_ordered_with<int[5], int (S::*)() const volatile&&>());
156static_assert(!check_totally_ordered_with < int[5], int (S::*)() const volatile&& noexcept > ());
157
158static_assert(check_totally_ordered_with<int (*)(), int (*)()>());
159static_assert(check_totally_ordered_with<int (*)(), int (&)()>());
160static_assert(!check_totally_ordered_with<int (*)(), int (S::*)()>());
161static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() noexcept>());
162static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() const>());
163static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() const noexcept>());
164static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() volatile>());
165static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() volatile noexcept>());
166static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() const volatile>());
167static_assert(!check_totally_ordered_with< int (*)(), int (S::*)() const volatile noexcept>());
168static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() &>());
169static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() & noexcept>());
170static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() const&>());
171static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() const & noexcept>());
172static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() volatile&>());
173static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() volatile & noexcept>());
174static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() const volatile&>());
175static_assert(!check_totally_ordered_with< int (*)(), int (S::*)() const volatile & noexcept>());
176static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() &&>());
177static_assert(!check_totally_ordered_with < int (*)(), int (S::*)() && noexcept > ());
178static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() const&&>());
179static_assert(!check_totally_ordered_with < int (*)(), int (S::*)() const&& noexcept > ());
180static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() volatile&&>());
181static_assert(!check_totally_ordered_with < int (*)(), int (S::*)() volatile&& noexcept > ());
182static_assert(!check_totally_ordered_with<int (*)(), int (S::*)() const volatile&&>());
183static_assert(!check_totally_ordered_with < int (*)(), int (S::*)() const volatile&& noexcept > ());
184
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(!check_totally_ordered_with<int (&)(), int (S::*)() const noexcept>());
190static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() volatile>());
191static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() volatile noexcept>());
192static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() const volatile>());
193static_assert(!check_totally_ordered_with< int (&)(), int (S::*)() const volatile noexcept>());
194static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() &>());
195static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() & noexcept>());
196static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() const&>());
197static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() const & noexcept>());
198static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() volatile&>());
199static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() volatile & noexcept>());
200static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() const volatile&>());
201static_assert(!check_totally_ordered_with< int (&)(), int (S::*)() const volatile & noexcept>());
202static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() &&>());
203static_assert(!check_totally_ordered_with < int (&)(), int (S::*)() && noexcept > ());
204static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() const&&>());
205static_assert(!check_totally_ordered_with < int (&)(), int (S::*)() const&& noexcept > ());
206static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() volatile&&>());
207static_assert(!check_totally_ordered_with < int (&)(), int (S::*)() volatile&& noexcept > ());
208static_assert(!check_totally_ordered_with<int (&)(), int (S::*)() const volatile&&>());
209static_assert(!check_totally_ordered_with < int (&)(), int (S::*)() const volatile&& noexcept > ());
210
211static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)()>());
212static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() noexcept>());
213static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() const>());
214static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() const noexcept>());
215static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() volatile>());
216static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() volatile noexcept>());
217static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() const volatile>());
218static_assert(!check_totally_ordered_with< int (S::*)(), int (S::*)() const volatile noexcept>());
219static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() &>());
220static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() & noexcept>());
221static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() const&>());
222static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() const & noexcept>());
223static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() volatile&>());
224static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() volatile & noexcept>());
225static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() const volatile&>());
226static_assert(!check_totally_ordered_with< int (S::*)(), int (S::*)() const volatile & noexcept>());
227static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() &&>());
228static_assert(!check_totally_ordered_with < int(S::*)(), int (S::*)() && noexcept > ());
229static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() const&&>());
230static_assert(!check_totally_ordered_with < int(S::*)(), int (S::*)() const&& noexcept > ());
231static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() volatile&&>());
232static_assert(!check_totally_ordered_with < int(S::*)(), int (S::*)() volatile&& noexcept > ());
233static_assert(!check_totally_ordered_with<int (S::*)(), int (S::*)() const volatile&&>());
234static_assert(!check_totally_ordered_with < int(S::*)(), int (S::*)() const volatile&& noexcept > ());
235
236static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() noexcept>());
237static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() const>());
238static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() const noexcept>());
239static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() volatile>());
240static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() volatile noexcept>());
241static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() const volatile>());
242static_assert(!check_totally_ordered_with< int (S::*)() noexcept, int (S::*)() const volatile noexcept>());
243static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() &>());
244static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() & noexcept>());
245static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() const&>());
246static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() const & noexcept>());
247static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() volatile&>());
248static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() volatile & noexcept>());
249static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() const volatile&>());
250static_assert(!check_totally_ordered_with< int (S::*)() noexcept, int (S::*)() const volatile & noexcept>());
251static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() &&>());
252static_assert(!check_totally_ordered_with < int(S::*)() noexcept, int (S::*)() && noexcept > ());
253static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() const&&>());
254static_assert(!check_totally_ordered_with < int(S::*)() noexcept, int (S::*)() const&& noexcept > ());
255static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() volatile&&>());
256static_assert(!check_totally_ordered_with < int(S::*)() noexcept, int (S::*)() volatile&& noexcept > ());
257static_assert(!check_totally_ordered_with<int (S::*)() noexcept, int (S::*)() const volatile&&>());
258static_assert(!check_totally_ordered_with < int(S::*)() noexcept, int (S::*)() const volatile&& noexcept > ());
259
260static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() const>());
261static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() const noexcept>());
262static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() volatile>());
263static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() volatile noexcept>());
264static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() const volatile>());
265static_assert(!check_totally_ordered_with< int (S::*)() const, int (S::*)() const volatile noexcept>());
266static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() &>());
267static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() & noexcept>());
268static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() const&>());
269static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() const & noexcept>());
270static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() volatile&>());
271static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() volatile & noexcept>());
272static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() const volatile&>());
273static_assert(!check_totally_ordered_with< int (S::*)() const, int (S::*)() const volatile & noexcept>());
274static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() &&>());
275static_assert(!check_totally_ordered_with < int(S::*)() const, int (S::*)() && noexcept > ());
276static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() const&&>());
277static_assert(!check_totally_ordered_with < int(S::*)() const, int (S::*)() const&& noexcept > ());
278static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() volatile&&>());
279static_assert(!check_totally_ordered_with < int(S::*)() const, int (S::*)() volatile&& noexcept > ());
280static_assert(!check_totally_ordered_with<int (S::*)() const, int (S::*)() const volatile&&>());
281static_assert(!check_totally_ordered_with < int(S::*)() const, int (S::*)() const volatile&& noexcept > ());
282
283static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const noexcept>());
284static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() volatile>());
285static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() volatile noexcept>());
286static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const volatile>());
287static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const volatile noexcept>());
288static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() &>());
289static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() & noexcept>());
290static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const&>());
291static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const & noexcept>());
292static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() volatile&>());
293static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() volatile & noexcept>());
294static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const volatile&>());
295static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const volatile & noexcept>());
296static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() &&>());
297static_assert(!check_totally_ordered_with < int(S::*)() const noexcept, int (S::*)() && noexcept > ());
298static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const&&>());
299static_assert(!check_totally_ordered_with < int(S::*)() const noexcept, int (S::*)() const&& noexcept > ());
300static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() volatile&&>());
301static_assert(!check_totally_ordered_with < int(S::*)() const noexcept, int (S::*)() volatile&& noexcept > ());
302static_assert(!check_totally_ordered_with<int (S::*)() const noexcept, int (S::*)() const volatile&&>());
303static_assert(!check_totally_ordered_with < int(S::*)() const noexcept, int (S::*)() const volatile&& noexcept > ());
304
305static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() volatile>());
306static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() volatile noexcept>());
307static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() const volatile>());
308static_assert(!check_totally_ordered_with< int (S::*)() volatile, int (S::*)() const volatile noexcept>());
309static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() &>());
310static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() & noexcept>());
311static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() const&>());
312static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() const & noexcept>());
313static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() volatile&>());
314static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() volatile & noexcept>());
315static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() const volatile&>());
316static_assert(!check_totally_ordered_with< int (S::*)() volatile, int (S::*)() const volatile & noexcept>());
317static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() &&>());
318static_assert(!check_totally_ordered_with < int(S::*)() volatile, int (S::*)() && noexcept > ());
319static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() const&&>());
320static_assert(!check_totally_ordered_with < int(S::*)() volatile, int (S::*)() const&& noexcept > ());
321static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() volatile&&>());
322static_assert(!check_totally_ordered_with < int(S::*)() volatile, int (S::*)() volatile&& noexcept > ());
323static_assert(!check_totally_ordered_with<int (S::*)() volatile, int (S::*)() const volatile&&>());
324static_assert(!check_totally_ordered_with < int(S::*)() volatile, int (S::*)() const volatile&& noexcept > ());
325
326static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() volatile noexcept>());
327static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() const volatile>());
328static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() const volatile noexcept>());
329static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() &>());
330static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() & noexcept>());
331static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() const&>());
332static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() const & noexcept>());
333static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() volatile&>());
334static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() volatile & noexcept>());
335static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() const volatile&>());
336static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() const volatile & noexcept>());
337static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() &&>());
338static_assert(!check_totally_ordered_with < int(S::*)() volatile noexcept, int (S::*)() && noexcept > ());
339static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() const&&>());
340static_assert(!check_totally_ordered_with < int(S::*)() volatile noexcept, int (S::*)() const&& noexcept > ());
341static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() volatile&&>());
342static_assert(!check_totally_ordered_with < int(S::*)() volatile noexcept, int (S::*)() volatile&& noexcept > ());
343static_assert(!check_totally_ordered_with<int (S::*)() volatile noexcept, int (S::*)() const volatile&&>());
344static_assert(!check_totally_ordered_with < int(S::*)() volatile noexcept, int (S::*)() const volatile&& noexcept > ());
345
346static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() const volatile>());
347static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() const volatile noexcept>());
348static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() &>());
349static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() & noexcept>());
350static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() const&>());
351static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() const & noexcept>());
352static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() volatile&>());
353static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() volatile & noexcept>());
354static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() const volatile&>());
355static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() const volatile & noexcept>());
356static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() &&>());
357static_assert(!check_totally_ordered_with < int(S::*)() const volatile, int (S::*)() && noexcept > ());
358static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() const&&>());
359static_assert(!check_totally_ordered_with < int(S::*)() const volatile, int (S::*)() const&& noexcept > ());
360static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() volatile&&>());
361static_assert(!check_totally_ordered_with < int(S::*)() const volatile, int (S::*)() volatile&& noexcept > ());
362static_assert(!check_totally_ordered_with<int (S::*)() const volatile, int (S::*)() const volatile&&>());
363static_assert(!check_totally_ordered_with < int(S::*)() const volatile, int (S::*)() const volatile&& noexcept > ());
364
365static_assert(
366 !check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() const volatile noexcept>());
367static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() &>());
368static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() & noexcept>());
369static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() const&>());
370static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() const & noexcept>());
371static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() volatile&>());
372static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() volatile & noexcept>());
373static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() const volatile&>());
374static_assert(
375 !check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() const volatile & noexcept>());
376static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() &&>());
377static_assert(!check_totally_ordered_with < int(S::*)() const volatile noexcept, int (S::*)() && noexcept > ());
378static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() const&&>());
379static_assert(!check_totally_ordered_with < int(S::*)() const volatile noexcept, int (S::*)() const&& noexcept > ());
380static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() volatile&&>());
381static_assert(!check_totally_ordered_with < int(S::*)() const volatile noexcept, int (S::*)() volatile&& noexcept > ());
382static_assert(!check_totally_ordered_with<int (S::*)() const volatile noexcept, int (S::*)() const volatile&&>());
383static_assert(!check_totally_ordered_with < int(S::*)() const volatile noexcept,
384 int (S::*)() const volatile&& noexcept > ());
385
386static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() &>());
387static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() & noexcept>());
388static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() const&>());
389static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() const & noexcept>());
390static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() volatile&>());
391static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() volatile & noexcept>());
392static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() const volatile&>());
393static_assert(!check_totally_ordered_with< int (S::*)() &, int (S::*)() const volatile & noexcept>());
394static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() &&>());
395static_assert(!check_totally_ordered_with < int(S::*)() &, int (S::*)() && noexcept > ());
396static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() const&&>());
397static_assert(!check_totally_ordered_with < int(S::*)() &, int (S::*)() const&& noexcept > ());
398static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() volatile&&>());
399static_assert(!check_totally_ordered_with < int(S::*)() &, int (S::*)() volatile&& noexcept > ());
400static_assert(!check_totally_ordered_with<int (S::*)() &, int (S::*)() const volatile&&>());
401static_assert(!check_totally_ordered_with < int(S::*)() &, int (S::*)() const volatile&& noexcept > ());
402
403static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() & noexcept>());
404static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() const&>());
405static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() const & noexcept>());
406static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() volatile&>());
407static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() volatile & noexcept>());
408static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() const volatile&>());
409static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() const volatile & noexcept>());
410static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() &&>());
411static_assert(!check_totally_ordered_with < int(S::*)() & noexcept, int (S::*)() && noexcept > ());
412static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() const&&>());
413static_assert(!check_totally_ordered_with < int(S::*)() & noexcept, int (S::*)() const&& noexcept > ());
414static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() volatile&&>());
415static_assert(!check_totally_ordered_with < int(S::*)() & noexcept, int (S::*)() volatile&& noexcept > ());
416static_assert(!check_totally_ordered_with<int (S::*)() & noexcept, int (S::*)() const volatile&&>());
417static_assert(!check_totally_ordered_with < int(S::*)() & noexcept, int (S::*)() const volatile&& noexcept > ());
418
419static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() const&>());
420static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() const & noexcept>());
421static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() volatile&>());
422static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() volatile & noexcept>());
423static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() const volatile&>());
424static_assert(!check_totally_ordered_with< int (S::*)() const&, int (S::*)() const volatile & noexcept>());
425static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() &&>());
426static_assert(!check_totally_ordered_with < int(S::*)() const&, int (S::*)() && noexcept > ());
427static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() const&&>());
428static_assert(!check_totally_ordered_with < int(S::*)() const&, int (S::*)() const&& noexcept > ());
429static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() volatile&&>());
430static_assert(!check_totally_ordered_with < int(S::*)() const&, int (S::*)() volatile&& noexcept > ());
431static_assert(!check_totally_ordered_with<int (S::*)() const&, int (S::*)() const volatile&&>());
432static_assert(!check_totally_ordered_with < int(S::*)() const&, int (S::*)() const volatile&& noexcept > ());
433
434static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() const & noexcept>());
435static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() volatile&>());
436static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() volatile & noexcept>());
437static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() const volatile&>());
438static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() const volatile & noexcept>());
439static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() &&>());
440static_assert(!check_totally_ordered_with < int(S::*)() const& noexcept, int (S::*)() && noexcept > ());
441static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() const&&>());
442static_assert(!check_totally_ordered_with < int(S::*)() const& noexcept, int (S::*)() const&& noexcept > ());
443static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() volatile&&>());
444static_assert(!check_totally_ordered_with < int(S::*)() const& noexcept, int (S::*)() volatile&& noexcept > ());
445static_assert(!check_totally_ordered_with<int (S::*)() const & noexcept, int (S::*)() const volatile&&>());
446static_assert(!check_totally_ordered_with < int(S::*)() const& noexcept, int (S::*)() const volatile&& noexcept > ());
447
448static_assert(!check_totally_ordered_with<int (S::*)() volatile&, int (S::*)() volatile&>());
449static_assert(!check_totally_ordered_with<int (S::*)() volatile&, int (S::*)() volatile & noexcept>());
450static_assert(!check_totally_ordered_with<int (S::*)() volatile&, int (S::*)() const volatile&>());
451static_assert(!check_totally_ordered_with<int (S::*)() volatile&, int (S::*)() const volatile & noexcept>());
452static_assert(!check_totally_ordered_with<int (S::*)() volatile&, int (S::*)() &&>());
453static_assert(!check_totally_ordered_with < int(S::*)() volatile&, int (S::*)() && noexcept > ());
454static_assert(!check_totally_ordered_with<int (S::*)() volatile&, int (S::*)() const&&>());
455static_assert(!check_totally_ordered_with < int(S::*)() volatile&, int (S::*)() const&& noexcept > ());
456static_assert(!check_totally_ordered_with<int (S::*)() volatile&, int (S::*)() volatile&&>());
457static_assert(!check_totally_ordered_with < int(S::*)() volatile&, int (S::*)() volatile&& noexcept > ());
458static_assert(!check_totally_ordered_with<int (S::*)() volatile&, int (S::*)() const volatile&&>());
459static_assert(!check_totally_ordered_with < int(S::*)() volatile&, int (S::*)() const volatile&& noexcept > ());
460
461static_assert(!check_totally_ordered_with<int (S::*)() volatile & noexcept, int (S::*)() volatile & noexcept>());
462static_assert(!check_totally_ordered_with<int (S::*)() volatile & noexcept, int (S::*)() const volatile&>());
463static_assert(!check_totally_ordered_with<int (S::*)() volatile & noexcept, int (S::*)() const volatile & noexcept>());
464static_assert(!check_totally_ordered_with<int (S::*)() volatile & noexcept, int (S::*)() &&>());
465static_assert(!check_totally_ordered_with < int(S::*)() volatile & noexcept, int (S::*)() && noexcept > ());
466static_assert(!check_totally_ordered_with<int (S::*)() volatile & noexcept, int (S::*)() const&&>());
467static_assert(!check_totally_ordered_with < int(S::*)() volatile & noexcept, int (S::*)() const&& noexcept > ());
468static_assert(!check_totally_ordered_with<int (S::*)() volatile & noexcept, int (S::*)() volatile&&>());
469static_assert(!check_totally_ordered_with < int(S::*)() volatile & noexcept, int (S::*)() volatile&& noexcept > ());
470static_assert(!check_totally_ordered_with<int (S::*)() volatile & noexcept, int (S::*)() const volatile&&>());
471static_assert(!check_totally_ordered_with < int(S::*)() volatile & noexcept,
472 int (S::*)() const volatile&& noexcept > ());
473
474static_assert(!check_totally_ordered_with<int (S::*)() const volatile&, int (S::*)() const volatile&>());
475static_assert(!check_totally_ordered_with<int (S::*)() const volatile&, int (S::*)() const volatile & noexcept>());
476static_assert(!check_totally_ordered_with<int (S::*)() const volatile&, int (S::*)() &&>());
477static_assert(!check_totally_ordered_with < int(S::*)() const volatile&, int (S::*)() && noexcept > ());
478static_assert(!check_totally_ordered_with<int (S::*)() const volatile&, int (S::*)() const&&>());
479static_assert(!check_totally_ordered_with < int(S::*)() const volatile&, int (S::*)() const&& noexcept > ());
480static_assert(!check_totally_ordered_with<int (S::*)() const volatile&, int (S::*)() volatile&&>());
481static_assert(!check_totally_ordered_with < int(S::*)() const volatile&, int (S::*)() volatile&& noexcept > ());
482static_assert(!check_totally_ordered_with<int (S::*)() const volatile&, int (S::*)() const volatile&&>());
483static_assert(!check_totally_ordered_with < int(S::*)() const volatile&, int (S::*)() const volatile&& noexcept > ());
484
485static_assert(
486 !check_totally_ordered_with<int (S::*)() const volatile & noexcept, int (S::*)() const volatile & noexcept>());
487static_assert(!check_totally_ordered_with< int (S::*)() const volatile & noexcept, int (S::*)() &&>());
488static_assert(!check_totally_ordered_with < int(S::*)() const volatile& noexcept, int (S::*)() && noexcept > ());
489static_assert(!check_totally_ordered_with< int (S::*)() const volatile & noexcept, int (S::*)() const&&>());
490static_assert(!check_totally_ordered_with < int(S::*)() const volatile& noexcept, int (S::*)() const&& noexcept > ());
491static_assert(!check_totally_ordered_with<int (S::*)() const volatile & noexcept, int (S::*)() volatile&&>());
492static_assert(!check_totally_ordered_with < int(S::*)() const volatile& noexcept,
493 int (S::*)() volatile&& noexcept > ());
494static_assert(!check_totally_ordered_with<int (S::*)() const volatile & noexcept, int (S::*)() const volatile&&>());
495static_assert(!check_totally_ordered_with < int(S::*)() const volatile& noexcept,
496 int (S::*)() const volatile&& noexcept > ());
497
498static_assert(!check_totally_ordered_with<int (S::*)() &&, int (S::*)() &&>());
499static_assert(!check_totally_ordered_with < int(S::*)() &&, int (S::*)() && noexcept > ());
500static_assert(!check_totally_ordered_with<int (S::*)() &&, int (S::*)() const&&>());
501static_assert(!check_totally_ordered_with < int(S::*)() &&, int (S::*)() const&& noexcept > ());
502static_assert(!check_totally_ordered_with<int (S::*)() &&, int (S::*)() volatile&&>());
503static_assert(!check_totally_ordered_with < int(S::*)() &&, int (S::*)() volatile&& noexcept > ());
504static_assert(!check_totally_ordered_with<int (S::*)() &&, int (S::*)() const volatile&&>());
505static_assert(!check_totally_ordered_with < int(S::*)() &&, int (S::*)() const volatile&& noexcept > ());
506
507static_assert(!check_totally_ordered_with < int(S::*)() && noexcept, int (S::*)() && noexcept > ());
508static_assert(!check_totally_ordered_with < int(S::*)() && noexcept, int (S::*)() const&& > ());
509static_assert(!check_totally_ordered_with < int(S::*)() && noexcept, int (S::*)() const&& noexcept > ());
510static_assert(!check_totally_ordered_with < int(S::*)() && noexcept, int (S::*)() volatile&& > ());
511static_assert(!check_totally_ordered_with < int(S::*)() && noexcept, int (S::*)() volatile&& noexcept > ());
512static_assert(!check_totally_ordered_with < int(S::*)() && noexcept, int (S::*)() const volatile&& > ());
513static_assert(!check_totally_ordered_with < int(S::*)() && noexcept, int (S::*)() const volatile&& noexcept > ());
514
515static_assert(!check_totally_ordered_with<int (S::*)() const&&, int (S::*)() const&&>());
516static_assert(!check_totally_ordered_with < int(S::*)() const&&, int (S::*)() const&& noexcept > ());
517static_assert(!check_totally_ordered_with<int (S::*)() const&&, int (S::*)() volatile&&>());
518static_assert(!check_totally_ordered_with < int(S::*)() const&&, int (S::*)() volatile&& noexcept > ());
519static_assert(!check_totally_ordered_with<int (S::*)() const&&, int (S::*)() const volatile&&>());
520static_assert(!check_totally_ordered_with < int(S::*)() const&&, int (S::*)() const volatile&& noexcept > ());
521
522static_assert(!check_totally_ordered_with < int(S::*)() const&& noexcept, int (S::*)() const&& noexcept > ());
523static_assert(!check_totally_ordered_with < int(S::*)() const&& noexcept, int (S::*)() volatile&& > ());
524static_assert(!check_totally_ordered_with < int(S::*)() const&& noexcept, int (S::*)() volatile&& noexcept > ());
525static_assert(!check_totally_ordered_with < int(S::*)() const&& noexcept, int (S::*)() const volatile&& > ());
526static_assert(!check_totally_ordered_with < int(S::*)() const&& noexcept, int (S::*)() const volatile&& noexcept > ());
527
528static_assert(!check_totally_ordered_with<int (S::*)() volatile&&, int (S::*)() volatile&&>());
529static_assert(!check_totally_ordered_with < int(S::*)() volatile&&, int (S::*)() volatile&& noexcept > ());
530static_assert(!check_totally_ordered_with<int (S::*)() volatile&&, int (S::*)() const volatile&&>());
531static_assert(!check_totally_ordered_with < int(S::*)() volatile&&, int (S::*)() const volatile&& noexcept > ());
532
533static_assert(!check_totally_ordered_with < int(S::*)() volatile && noexcept, int (S::*)() volatile&& noexcept > ());
534static_assert(!check_totally_ordered_with < int(S::*)() volatile && noexcept, int (S::*)() const volatile&& > ());
535static_assert(!check_totally_ordered_with < int(S::*)() volatile && noexcept,
536 int (S::*)() const volatile&& noexcept > ());
537
538static_assert(!check_totally_ordered_with<int (S::*)() const volatile&&, int (S::*)() const volatile&&>());
539static_assert(!check_totally_ordered_with < int(S::*)() const volatile&&, int (S::*)() const volatile&& noexcept > ());
540static_assert(!check_totally_ordered_with < int(S::*)() const volatile&& noexcept,
541 int (S::*)() const volatile&& noexcept > ());
542
543#if !defined(TEST_COMPILER_GCC)
544static_assert(!check_totally_ordered_with<std::nullptr_t, int>());
545
546static_assert(!check_totally_ordered_with<std::nullptr_t, int*>());
547static_assert(!check_totally_ordered_with<std::nullptr_t, int[]>());
548static_assert(!check_totally_ordered_with<std::nullptr_t, int[5]>());
549static_assert(!check_totally_ordered_with<std::nullptr_t, int (*)()>());
550static_assert(!check_totally_ordered_with<std::nullptr_t, int (&)()>());
551#endif
552
553static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)()>());
554static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() noexcept>());
555static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() const>());
556static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() const noexcept>());
557static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() volatile>());
558static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() volatile noexcept>());
559static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() const volatile>());
560static_assert(!check_totally_ordered_with< std::nullptr_t, int (S::*)() const volatile noexcept>());
561static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() &>());
562static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() & noexcept>());
563static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() const&>());
564static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() const & noexcept>());
565static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() volatile&>());
566static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() volatile & noexcept>());
567static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() const volatile&>());
568static_assert(!check_totally_ordered_with< std::nullptr_t, int (S::*)() const volatile & noexcept>());
569static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() &&>());
570static_assert(!check_totally_ordered_with < std::nullptr_t, int (S::*)() && noexcept > ());
571static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() const&&>());
572static_assert(!check_totally_ordered_with < std::nullptr_t, int (S::*)() const&& noexcept > ());
573static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() volatile&&>());
574static_assert(!check_totally_ordered_with < std::nullptr_t, int (S::*)() volatile&& noexcept > ());
575static_assert(!check_totally_ordered_with<std::nullptr_t, int (S::*)() const volatile&&>());
576static_assert(!check_totally_ordered_with < std::nullptr_t, int (S::*)() const volatile&& noexcept > ());
577
578static_assert(!std::equality_comparable_with<void, int>);
579static_assert(!std::equality_comparable_with<void, int*>);
580static_assert(!std::equality_comparable_with<void, std::nullptr_t>);
581static_assert(!std::equality_comparable_with<void, int[5]>);
582static_assert(!std::equality_comparable_with<void, int (*)()>);
583static_assert(!std::equality_comparable_with<void, int (&)()>);
584static_assert(!std::equality_comparable_with<void, int S::*>);
585static_assert(!std::equality_comparable_with<void, int (S::*)()>);
586static_assert(!std::equality_comparable_with<void, int (S::*)() noexcept>);
587static_assert(!std::equality_comparable_with<void, int (S::*)() const>);
588static_assert(!std::equality_comparable_with<void, int (S::*)() const noexcept>);
589static_assert(!std::equality_comparable_with<void, int (S::*)() volatile>);
590static_assert(!std::equality_comparable_with<void, int (S::*)() volatile noexcept>);
591static_assert(!std::equality_comparable_with<void, int (S::*)() const volatile>);
592static_assert(!std::equality_comparable_with<void, int (S::*)() const volatile noexcept>);
593static_assert(!std::equality_comparable_with<void, int (S::*)() &>);
594static_assert(!std::equality_comparable_with<void, int (S::*)() & noexcept>);
595static_assert(!std::equality_comparable_with<void, int (S::*)() const&>);
596static_assert(!std::equality_comparable_with<void, int (S::*)() const & noexcept>);
597static_assert(!std::equality_comparable_with<void, int (S::*)() volatile&>);
598static_assert(!std::equality_comparable_with<void, int (S::*)() volatile & noexcept>);
599static_assert(!std::equality_comparable_with<void, int (S::*)() const volatile&>);
600static_assert(!std::equality_comparable_with<void, int (S::*)() const volatile & noexcept>);
601static_assert(!std::equality_comparable_with<void, int (S::*)() &&>);
602static_assert(!std::equality_comparable_with < void, int (S::*)() && noexcept >);
603static_assert(!std::equality_comparable_with<void, int (S::*)() const&&>);
604static_assert(!std::equality_comparable_with < void, int (S::*)() const&& noexcept >);
605static_assert(!std::equality_comparable_with<void, int (S::*)() volatile&&>);
606static_assert(!std::equality_comparable_with < void, int (S::*)() volatile&& noexcept >);
607static_assert(!std::equality_comparable_with<void, int (S::*)() const volatile&&>);
608static_assert(!std::equality_comparable_with < void, int (S::*)() const volatile&& noexcept >);
609} // namespace fundamentals
610
611namespace standard_types {
612static_assert(check_totally_ordered_with<std::array<int, 10>, std::array<int, 10> >());
613static_assert(!check_totally_ordered_with<std::array<int, 10>, std::array<double, 10> >());
614static_assert(check_totally_ordered_with<std::deque<int>, std::deque<int> >());
615static_assert(!check_totally_ordered_with<std::deque<int>, std::vector<int> >());
616static_assert(check_totally_ordered_with<std::forward_list<int>, std::forward_list<int> >());
617static_assert(!check_totally_ordered_with<std::forward_list<int>, std::vector<int> >());
618static_assert(check_totally_ordered_with<std::list<int>, std::list<int> >());
619static_assert(!check_totally_ordered_with<std::list<int>, std::vector<int> >());
620
621static_assert(check_totally_ordered_with<std::map<int, void*>, std::map<int, void*> >());
622static_assert(!check_totally_ordered_with<std::map<int, void*>, std::vector<int> >());
623static_assert(check_totally_ordered_with<std::optional<std::vector<int> >, std::optional<std::vector<int> > >());
624static_assert(check_totally_ordered_with<std::optional<std::vector<int> >, std::vector<int> >());
625static_assert(check_totally_ordered_with<std::vector<int>, std::vector<int> >());
626static_assert(!check_totally_ordered_with<std::vector<int>, int>());
627
628struct A {};
629static_assert(!check_totally_ordered_with<std::optional<std::vector<A> >, std::optional<std::vector<A> > >());
630static_assert(!check_totally_ordered_with<std::optional<std::vector<A> >, std::vector<A> >());
631struct B {};
632static_assert(!check_totally_ordered_with<std::vector<A>, std::vector<B> >());
633static_assert(!check_totally_ordered_with<std::optional<A>, std::optional<B> >());
634} // namespace standard_types
635
636namespace types_fit_for_purpose {
637static_assert(!check_totally_ordered_with<cxx20_member_eq, cxx20_member_eq>());
638static_assert(!check_totally_ordered_with<cxx20_friend_eq, cxx20_friend_eq>());
639static_assert(!check_totally_ordered_with<cxx20_member_eq, cxx20_friend_eq>());
640
641static_assert(check_totally_ordered_with<member_three_way_comparable, member_three_way_comparable>());
642static_assert(check_totally_ordered_with<friend_three_way_comparable, friend_three_way_comparable>());
643static_assert(!check_totally_ordered_with<member_three_way_comparable, friend_three_way_comparable>());
644
645static_assert(check_totally_ordered_with<explicit_operators, explicit_operators>());
646static_assert(!check_totally_ordered_with<equality_comparable_with_ec1, equality_comparable_with_ec1>());
647static_assert(check_totally_ordered_with<different_return_types, different_return_types>());
648static_assert(!check_totally_ordered_with<explicit_operators, equality_comparable_with_ec1>());
649static_assert(check_totally_ordered_with<explicit_operators, different_return_types>());
650
651static_assert(!check_totally_ordered_with<one_way_eq, one_way_eq>());
652static_assert(std::common_reference_with<one_way_eq const&, explicit_operators const&> &&
653 !check_totally_ordered_with<one_way_eq, explicit_operators>());
654
655static_assert(!check_totally_ordered_with<one_way_ne, one_way_ne>());
656static_assert(std::common_reference_with<one_way_ne const&, explicit_operators const&> &&
657 !check_totally_ordered_with<one_way_ne, explicit_operators>());
658
659static_assert(check_totally_ordered_with<totally_ordered_with_others, partial_ordering_totally_ordered_with>());
660static_assert(check_totally_ordered_with<totally_ordered_with_others, weak_ordering_totally_ordered_with>());
661static_assert(check_totally_ordered_with<totally_ordered_with_others, strong_ordering_totally_ordered_with>());
662
663static_assert(!check_totally_ordered_with<totally_ordered_with_others, eq_returns_explicit_bool>());
664static_assert(!check_totally_ordered_with<totally_ordered_with_others, ne_returns_explicit_bool>());
665static_assert(std::equality_comparable_with<totally_ordered_with_others, lt_returns_explicit_bool> &&
666 !check_totally_ordered_with<totally_ordered_with_others, lt_returns_explicit_bool>());
667static_assert(std::equality_comparable_with<totally_ordered_with_others, gt_returns_explicit_bool> &&
668 !check_totally_ordered_with<totally_ordered_with_others, gt_returns_explicit_bool>());
669static_assert(std::equality_comparable_with<totally_ordered_with_others, le_returns_explicit_bool> &&
670 !check_totally_ordered_with<totally_ordered_with_others, le_returns_explicit_bool>());
671static_assert(std::equality_comparable_with<totally_ordered_with_others, ge_returns_explicit_bool> &&
672 !check_totally_ordered_with<totally_ordered_with_others, ge_returns_explicit_bool>());
673static_assert(check_totally_ordered_with<totally_ordered_with_others, returns_true_type>());
674static_assert(check_totally_ordered_with<totally_ordered_with_others, returns_int_ptr>());
675
676static_assert(std::totally_ordered<no_lt_not_totally_ordered_with> &&
677 std::equality_comparable_with<totally_ordered_with_others, no_lt_not_totally_ordered_with> &&
678 !check_totally_ordered_with<totally_ordered_with_others, no_lt_not_totally_ordered_with>());
679static_assert(std::totally_ordered<no_gt_not_totally_ordered_with> &&
680 std::equality_comparable_with<totally_ordered_with_others, no_gt_not_totally_ordered_with> &&
681 !check_totally_ordered_with<totally_ordered_with_others, no_gt_not_totally_ordered_with>());
682static_assert(std::totally_ordered<no_le_not_totally_ordered_with> &&
683 std::equality_comparable_with<totally_ordered_with_others, no_le_not_totally_ordered_with> &&
684 !check_totally_ordered_with<totally_ordered_with_others, no_le_not_totally_ordered_with>());
685static_assert(std::totally_ordered<no_ge_not_totally_ordered_with> &&
686 std::equality_comparable_with<totally_ordered_with_others, no_ge_not_totally_ordered_with> &&
687 !check_totally_ordered_with<totally_ordered_with_others, no_ge_not_totally_ordered_with>());
688} // namespace types_fit_for_purpose
689

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