2 //===-------------------------- concepts ----------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_CONCEPTS
11 #define _LIBCPP_CONCEPTS
16 // [concepts.lang], language-related concepts
17 // [concept.same], concept same_as
18 template<class T, class U>
19 concept same_as = see below;
21 // [concept.derived], concept derived_from
22 template<class Derived, class Base>
23 concept derived_from = see below;
25 // [concept.convertible], concept convertible_to
26 template<class From, class To>
27 concept convertible_to = see below;
29 // [concept.commonref], concept common_reference_with
30 template<class T, class U>
31 concept common_reference_with = see below;
33 // [concept.common], concept common_with
34 template<class T, class U>
35 concept common_with = see below;
37 // [concepts.arithmetic], arithmetic concepts
39 concept integral = see below;
41 concept signed_integral = see below;
43 concept unsigned_integral = see below;
45 concept floating_point = see below;
47 // [concept.assignable], concept assignable_from
48 template<class LHS, class RHS>
49 concept assignable_from = see below;
51 // [concept.swappable], concept swappable
53 inline namespace unspecified {
54 inline constexpr unspecified swap = unspecified;
58 concept swappable = see below;
59 template<class T, class U>
60 concept swappable_with = see below;
62 // [concept.destructible], concept destructible
64 concept destructible = see below;
66 // [concept.constructible], concept constructible_from
67 template<class T, class... Args>
68 concept constructible_from = see below;
70 // [concept.defaultconstructible], concept default_constructible
72 concept default_constructible = see below;
74 // [concept.moveconstructible], concept move_constructible
76 concept move_constructible = see below;
78 // [concept.copyconstructible], concept copy_constructible
80 concept copy_constructible = see below;
82 // [concepts.compare], comparison concepts
83 // [concept.boolean], concept boolean
85 concept boolean = see below;
87 // [concept.equalitycomparable], concept equality_comparable
89 concept equality_comparable = see below;
90 template<class T, class U>
91 concept equality_comparable_with = see below;
93 // [concept.totallyordered], concept totally_ordered
95 concept totally_ordered = see below;
96 template<class T, class U>
97 concept totally_ordered_with = see below;
99 // [concepts.object], object concepts
101 concept movable = see below;
103 concept copyable = see below;
105 concept semiregular = see below;
107 concept regular = see below;
109 // [concepts.callable], callable concepts
110 // [concept.invocable], concept invocable
111 template<class F, class... Args>
112 concept invocable = see below;
114 // [concept.regularinvocable], concept regular_invocable
115 template<class F, class... Args>
116 concept regular_invocable = see below;
118 // [concept.predicate], concept predicate
119 template<class F, class... Args>
120 concept predicate = see below;
122 // [concept.relation], concept relation
123 template<class R, class T, class U>
124 concept relation = see below;
126 // [concept.equiv], concept equivalence_relation
127 template<class R, class T, class U>
128 concept equivalence_relation = see below;
130 // [concept.strictweakorder], concept strict_weak_order
131 template<class R, class T, class U>
132 concept strict_weak_order = see below;
138 #include <type_traits>
141 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
142 #pragma GCC system_header
146 #include <__undef_macros>
148 _LIBCPP_BEGIN_NAMESPACE_STD
150 #if _LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
154 template<class _Tp, class _Up>
155 concept __same_as_impl = _VSTD::_IsSame<_Tp, _Up>::value;
157 template<class _Tp, class _Up>
158 concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>;
160 #endif //_LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
162 _LIBCPP_END_NAMESPACE_STD
166 #endif // _LIBCPP_CONCEPTS