[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / libcxx / include / __concepts / totally_ordered.h
blobd8dd4a4944d07a85a90d7c92b53429480e12244e
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 //===----------------------------------------------------------------------===//
9 #ifndef _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H
10 #define _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H
12 #include <__concepts/boolean_testable.h>
13 #include <__concepts/equality_comparable.h>
14 #include <__config>
15 #include <type_traits>
17 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18 #pragma GCC system_header
19 #endif
21 _LIBCPP_BEGIN_NAMESPACE_STD
23 #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
25 // [concept.totallyordered]
27 template<class _Tp, class _Up>
28 concept __partially_ordered_with =
29 requires(__make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) {
30 { __t < __u } -> __boolean_testable;
31 { __t > __u } -> __boolean_testable;
32 { __t <= __u } -> __boolean_testable;
33 { __t >= __u } -> __boolean_testable;
34 { __u < __t } -> __boolean_testable;
35 { __u > __t } -> __boolean_testable;
36 { __u <= __t } -> __boolean_testable;
37 { __u >= __t } -> __boolean_testable;
40 template<class _Tp>
41 concept totally_ordered = equality_comparable<_Tp> && __partially_ordered_with<_Tp, _Tp>;
43 template<class _Tp, class _Up>
44 concept totally_ordered_with =
45 totally_ordered<_Tp> && totally_ordered<_Up> &&
46 equality_comparable_with<_Tp, _Up> &&
47 totally_ordered<
48 common_reference_t<
49 __make_const_lvalue_ref<_Tp>,
50 __make_const_lvalue_ref<_Up>>> &&
51 __partially_ordered_with<_Tp, _Up>;
53 #endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
55 _LIBCPP_END_NAMESPACE_STD
57 #endif // _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H