2 //===----------------------------------------------------------------------===//
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.default.init], concept default_initializable
72 concept default_initializable = 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 // [concept.equalitycomparable], concept equality_comparable
84 concept equality_comparable = see below;
85 template<class T, class U>
86 concept equality_comparable_with = see below;
88 // [concept.totallyordered], concept totally_ordered
90 concept totally_ordered = see below;
91 template<class T, class U>
92 concept totally_ordered_with = see below;
94 // [concepts.object], object concepts
96 concept movable = see below;
98 concept copyable = see below;
100 concept semiregular = see below;
102 concept regular = see below;
104 // [concepts.callable], callable concepts
105 // [concept.invocable], concept invocable
106 template<class F, class... Args>
107 concept invocable = see below;
109 // [concept.regularinvocable], concept regular_invocable
110 template<class F, class... Args>
111 concept regular_invocable = see below;
113 // [concept.predicate], concept predicate
114 template<class F, class... Args>
115 concept predicate = see below;
117 // [concept.relation], concept relation
118 template<class R, class T, class U>
119 concept relation = see below;
121 // [concept.equiv], concept equivalence_relation
122 template<class R, class T, class U>
123 concept equivalence_relation = see below;
125 // [concept.strictweakorder], concept strict_weak_order
126 template<class R, class T, class U>
127 concept strict_weak_order = see below;
134 #if _LIBCPP_STD_VER >= 20
135 # include <__concepts/arithmetic.h>
136 # include <__concepts/assignable.h>
137 # include <__concepts/boolean_testable.h>
138 # include <__concepts/class_or_enum.h>
139 # include <__concepts/common_reference_with.h>
140 # include <__concepts/common_with.h>
141 # include <__concepts/constructible.h>
142 # include <__concepts/convertible_to.h>
143 # include <__concepts/copyable.h>
144 # include <__concepts/derived_from.h>
145 # include <__concepts/destructible.h>
146 # include <__concepts/different_from.h>
147 # include <__concepts/equality_comparable.h>
148 # include <__concepts/invocable.h>
149 # include <__concepts/movable.h>
150 # include <__concepts/predicate.h>
151 # include <__concepts/regular.h>
152 # include <__concepts/relation.h>
153 # include <__concepts/same_as.h>
154 # include <__concepts/semiregular.h>
155 # include <__concepts/swappable.h>
156 # include <__concepts/totally_ordered.h>
157 #endif // _LIBCPP_STD_VER >= 20
161 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
163 # include <type_traits>
166 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
167 # pragma GCC system_header
170 #endif // _LIBCPP_CONCEPTS