xref: /llvm-project/libcxx/include/concepts (revision b9a2658a3e8bd13b0f9e7a8a440832a95b377216)
1601f7631SEric Fiselier// -*- C++ -*-
258915667SArthur O'Dwyer//===----------------------------------------------------------------------===//
3601f7631SEric Fiselier//
4601f7631SEric Fiselier// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5601f7631SEric Fiselier// See https://llvm.org/LICENSE.txt for license information.
6601f7631SEric Fiselier// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7601f7631SEric Fiselier//
8601f7631SEric Fiselier//===----------------------------------------------------------------------===//
9601f7631SEric Fiselier
10601f7631SEric Fiselier#ifndef _LIBCPP_CONCEPTS
11601f7631SEric Fiselier#define _LIBCPP_CONCEPTS
12601f7631SEric Fiselier
13601f7631SEric Fiselier/*
14601f7631SEric Fiselier    concepts synopsis
15601f7631SEric Fiseliernamespace std {
16601f7631SEric Fiselier  // [concepts.lang], language-related concepts
17601f7631SEric Fiselier  // [concept.same], concept same_as
18601f7631SEric Fiselier  template<class T, class U>
19601f7631SEric Fiselier    concept same_as = see below;
20601f7631SEric Fiselier
21601f7631SEric Fiselier  // [concept.derived], concept derived_from
22601f7631SEric Fiselier  template<class Derived, class Base>
23601f7631SEric Fiselier    concept derived_from = see below;
24601f7631SEric Fiselier
25601f7631SEric Fiselier  // [concept.convertible], concept convertible_to
26601f7631SEric Fiselier  template<class From, class To>
27601f7631SEric Fiselier    concept convertible_to = see below;
28601f7631SEric Fiselier
29601f7631SEric Fiselier  // [concept.commonref], concept common_reference_with
30601f7631SEric Fiselier  template<class T, class U>
31601f7631SEric Fiselier    concept common_reference_with = see below;
32601f7631SEric Fiselier
33601f7631SEric Fiselier  // [concept.common], concept common_with
34601f7631SEric Fiselier  template<class T, class U>
35601f7631SEric Fiselier    concept common_with = see below;
36601f7631SEric Fiselier
37601f7631SEric Fiselier  // [concepts.arithmetic], arithmetic concepts
38601f7631SEric Fiselier  template<class T>
39601f7631SEric Fiselier    concept integral = see below;
40601f7631SEric Fiselier  template<class T>
41601f7631SEric Fiselier    concept signed_integral = see below;
42601f7631SEric Fiselier  template<class T>
43601f7631SEric Fiselier    concept unsigned_integral = see below;
44601f7631SEric Fiselier  template<class T>
45601f7631SEric Fiselier    concept floating_point = see below;
46601f7631SEric Fiselier
47601f7631SEric Fiselier  // [concept.assignable], concept assignable_from
48601f7631SEric Fiselier  template<class LHS, class RHS>
49601f7631SEric Fiselier    concept assignable_from = see below;
50601f7631SEric Fiselier
51601f7631SEric Fiselier  // [concept.swappable], concept swappable
52601f7631SEric Fiselier  namespace ranges {
53601f7631SEric Fiselier    inline namespace unspecified {
54601f7631SEric Fiselier      inline constexpr unspecified swap = unspecified;
55601f7631SEric Fiselier    }
56601f7631SEric Fiselier  }
57601f7631SEric Fiselier  template<class T>
58601f7631SEric Fiselier    concept swappable = see below;
59601f7631SEric Fiselier  template<class T, class U>
60601f7631SEric Fiselier    concept swappable_with = see below;
61601f7631SEric Fiselier
62601f7631SEric Fiselier  // [concept.destructible], concept destructible
63601f7631SEric Fiselier  template<class T>
64601f7631SEric Fiselier    concept destructible = see below;
65601f7631SEric Fiselier
66601f7631SEric Fiselier  // [concept.constructible], concept constructible_from
67601f7631SEric Fiselier  template<class T, class... Args>
68601f7631SEric Fiselier    concept constructible_from = see below;
69601f7631SEric Fiselier
70920c0f7eSChristopher Di Bella  // [concept.default.init], concept default_initializable
71601f7631SEric Fiselier  template<class T>
72920c0f7eSChristopher Di Bella    concept default_initializable = see below;
73601f7631SEric Fiselier
74601f7631SEric Fiselier  // [concept.moveconstructible], concept move_constructible
75601f7631SEric Fiselier  template<class T>
76601f7631SEric Fiselier    concept move_constructible = see below;
77601f7631SEric Fiselier
78601f7631SEric Fiselier  // [concept.copyconstructible], concept copy_constructible
79601f7631SEric Fiselier  template<class T>
80601f7631SEric Fiselier    concept copy_constructible = see below;
81601f7631SEric Fiselier
82601f7631SEric Fiselier  // [concept.equalitycomparable], concept equality_comparable
83601f7631SEric Fiselier  template<class T>
84601f7631SEric Fiselier    concept equality_comparable = see below;
85601f7631SEric Fiselier  template<class T, class U>
86601f7631SEric Fiselier    concept equality_comparable_with = see below;
87601f7631SEric Fiselier
88601f7631SEric Fiselier  // [concept.totallyordered], concept totally_ordered
89601f7631SEric Fiselier  template<class T>
90601f7631SEric Fiselier    concept totally_ordered = see below;
91601f7631SEric Fiselier  template<class T, class U>
92601f7631SEric Fiselier    concept totally_ordered_with = see below;
93601f7631SEric Fiselier
94601f7631SEric Fiselier  // [concepts.object], object concepts
95601f7631SEric Fiselier  template<class T>
96601f7631SEric Fiselier    concept movable = see below;
97601f7631SEric Fiselier  template<class T>
98601f7631SEric Fiselier    concept copyable = see below;
99601f7631SEric Fiselier  template<class T>
100601f7631SEric Fiselier    concept semiregular = see below;
101601f7631SEric Fiselier  template<class T>
102601f7631SEric Fiselier    concept regular = see below;
103601f7631SEric Fiselier
104601f7631SEric Fiselier  // [concepts.callable], callable concepts
105601f7631SEric Fiselier  // [concept.invocable], concept invocable
106601f7631SEric Fiselier  template<class F, class... Args>
107601f7631SEric Fiselier    concept invocable = see below;
108601f7631SEric Fiselier
109601f7631SEric Fiselier  // [concept.regularinvocable], concept regular_invocable
110601f7631SEric Fiselier  template<class F, class... Args>
111601f7631SEric Fiselier    concept regular_invocable = see below;
112601f7631SEric Fiselier
113601f7631SEric Fiselier  // [concept.predicate], concept predicate
114601f7631SEric Fiselier  template<class F, class... Args>
115601f7631SEric Fiselier    concept predicate = see below;
116601f7631SEric Fiselier
117601f7631SEric Fiselier  // [concept.relation], concept relation
118601f7631SEric Fiselier  template<class R, class T, class U>
119601f7631SEric Fiselier    concept relation = see below;
120601f7631SEric Fiselier
121601f7631SEric Fiselier  // [concept.equiv], concept equivalence_relation
122601f7631SEric Fiselier  template<class R, class T, class U>
123601f7631SEric Fiselier    concept equivalence_relation = see below;
124601f7631SEric Fiselier
125601f7631SEric Fiselier  // [concept.strictweakorder], concept strict_weak_order
126601f7631SEric Fiselier  template<class R, class T, class U>
127601f7631SEric Fiselier    concept strict_weak_order = see below;
128601f7631SEric Fiselier}
129601f7631SEric Fiselier
130601f7631SEric Fiselier*/
131601f7631SEric Fiselier
132*b9a2658aSNikolas Klauser#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
133*b9a2658aSNikolas Klauser#  include <__cxx03/concepts>
134*b9a2658aSNikolas Klauser#else
135d5c654b5SNikolas Klauser#  include <__config>
136d5c654b5SNikolas Klauser
137d5c654b5SNikolas Klauser#  if _LIBCPP_STD_VER >= 20
13858915667SArthur O'Dwyer#    include <__concepts/arithmetic.h>
13958915667SArthur O'Dwyer#    include <__concepts/assignable.h>
14058915667SArthur O'Dwyer#    include <__concepts/boolean_testable.h>
14158915667SArthur O'Dwyer#    include <__concepts/class_or_enum.h>
14258915667SArthur O'Dwyer#    include <__concepts/common_reference_with.h>
14358915667SArthur O'Dwyer#    include <__concepts/common_with.h>
14458915667SArthur O'Dwyer#    include <__concepts/constructible.h>
14558915667SArthur O'Dwyer#    include <__concepts/convertible_to.h>
14658915667SArthur O'Dwyer#    include <__concepts/copyable.h>
14758915667SArthur O'Dwyer#    include <__concepts/derived_from.h>
14858915667SArthur O'Dwyer#    include <__concepts/destructible.h>
14958915667SArthur O'Dwyer#    include <__concepts/different_from.h>
15058915667SArthur O'Dwyer#    include <__concepts/equality_comparable.h>
15158915667SArthur O'Dwyer#    include <__concepts/invocable.h>
15258915667SArthur O'Dwyer#    include <__concepts/movable.h>
15358915667SArthur O'Dwyer#    include <__concepts/predicate.h>
15458915667SArthur O'Dwyer#    include <__concepts/regular.h>
15558915667SArthur O'Dwyer#    include <__concepts/relation.h>
15658915667SArthur O'Dwyer#    include <__concepts/same_as.h>
15758915667SArthur O'Dwyer#    include <__concepts/semiregular.h>
15858915667SArthur O'Dwyer#    include <__concepts/swappable.h>
15958915667SArthur O'Dwyer#    include <__concepts/totally_ordered.h>
160d5c654b5SNikolas Klauser#  endif // _LIBCPP_STD_VER >= 20
161d5c654b5SNikolas Klauser
162601f7631SEric Fiselier#  include <version>
163601f7631SEric Fiselier
164e99c4906SNikolas Klauser#  if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
165d5c654b5SNikolas Klauser#    include <cstddef>
16666ba7c32SNikolas Klauser#    include <type_traits>
16766ba7c32SNikolas Klauser#  endif
16866ba7c32SNikolas Klauser
169601f7631SEric Fiselier#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
170601f7631SEric Fiselier#    pragma GCC system_header
171601f7631SEric Fiselier#  endif
172*b9a2658aSNikolas Klauser#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
173601f7631SEric Fiselier
174601f7631SEric Fiselier#endif // _LIBCPP_CONCEPTS
175