blob: 338ea0d04c387b972c03c186e40f5b8b7653c38d [file] [log] [blame]
Mark de Weveraf59b2d2020-11-24 18:08:02 +01001// -*- C++ -*-
2//===--------------------------- ranges -----------------------------------===//
3//
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
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_RANGES
11#define _LIBCPP_RANGES
12
13/*
14
15#include <compare> // see [compare.syn]
16#include <initializer_list> // see [initializer.list.syn]
17#include <iterator> // see [iterator.synopsis]
18
19namespace std::ranges {
Christopher Di Bella66ce1292021-04-11 05:08:32 +000020 inline namespace unspecified {
21 // [range.access], range access
22 inline constexpr unspecified begin = unspecified;
23 inline constexpr unspecified end = unspecified;
24 inline constexpr unspecified cbegin = unspecified;
25 inline constexpr unspecified cend = unspecified;
zoecarvere3a4b182021-04-22 09:29:02 -070026
27 inline constexpr unspecified size = unspecified;
zoecarver9ce1b4d2021-04-23 11:23:22 -070028 inline constexpr unspecified ssize = unspecified;
Christopher Di Bella66ce1292021-04-11 05:08:32 +000029 }
30
Mark de Weveraf59b2d2020-11-24 18:08:02 +010031 // [range.range], ranges
32 template<class T>
Christopher Di Bella9db3ef22021-04-11 17:40:30 +000033 concept range = see below;
34
35 template<class T>
Mark de Weveraf59b2d2020-11-24 18:08:02 +010036 inline constexpr bool enable_borrowed_range = false;
Christopher Di Bella66ce1292021-04-11 05:08:32 +000037
38 template<class T>
39 using iterator_t = decltype(ranges::begin(declval<T&>()));
Christopher Di Bella9db3ef22021-04-11 17:40:30 +000040 template<class T>
41 using iterator_t = decltype(ranges::begin(declval<T&>()));
42 template<range R>
43 using sentinel_t = decltype(ranges::end(declval<R&>()));
44 template<range R>
45 using range_difference_t = iter_difference_t<iterator_t<R>>;
46 template<range R>
47 using range_value_t = iter_value_t<iterator_t<R>>;
48 template<range R>
49 using range_reference_t = iter_reference_t<iterator_t<R>>;
50 template<range R>
51 using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>;
52
Christopher Di Bellae16d01d2021-05-13 19:34:06 +000053 // [range.sized]
54 template<class>
55 inline constexpr bool disable_sized_range = false;
56
57 template<class T>
58 concept sized_range = ...;
59
Louis Dionnefa8282c2021-04-28 15:22:11 -040060 // [range.view], views
61 template<class T>
62 inline constexpr bool enable_view = ...;
63
64 struct view_base { };
65
66 template<class T>
67 concept view = ...;
68
Christopher Di Bella9db3ef22021-04-11 17:40:30 +000069 // [range.refinements], other range refinements
Christopher Di Bella8250c632021-04-11 19:04:52 +000070 template<class T>
71 concept input_range = see below;
72
Christopher Di Bella8f1370d2021-04-11 22:11:03 +000073 template<class T>
74 concept forward_range = see below;
75
Christopher Di Bella10a31472021-04-12 01:16:45 +000076 template<class T>
77 concept bidirectional_range = see below;
78
zoecarver3dcd5a12021-06-14 16:08:15 -040079 template<class T>
80 concept random_access_range = see below;
81
82 template<class T>
83 concept contiguous_range = see below;
84
Christopher Di Bella9db3ef22021-04-11 17:40:30 +000085 template <class _Tp>
86 concept common_range = see below;
zoecarver528b66d2021-04-30 15:24:28 -070087
88 // [view.interface], class template view_interface
89 template<class D>
90 requires is_class_v<D> && same_as<D, remove_cv_t<D>>
91 class view_interface;
zoecarver671223d2021-05-26 14:25:02 -070092
93 // [range.empty], empty view
94 template<class T>
95 requires is_object_v<T>
96 class empty_view;
Mark de Weveraf59b2d2020-11-24 18:08:02 +010097}
98
99*/
100
101#include <__config>
Christopher Di Bella66ce1292021-04-11 05:08:32 +0000102#include <__ranges/access.h>
zoecarver982808d2021-05-06 15:31:45 -0700103#include <__ranges/all.h>
Christopher Di Bella9db3ef22021-04-11 17:40:30 +0000104#include <__ranges/concepts.h>
zoecarver2fbc4d22021-04-23 15:22:18 -0700105#include <__ranges/data.h>
zoecarver545d1d42021-05-06 17:39:53 -0700106#include <__ranges/drop_view.h>
zoecarver85d69332021-04-23 12:34:22 -0700107#include <__ranges/empty.h>
zoecarver671223d2021-05-26 14:25:02 -0700108#include <__ranges/empty_view.h>
Mark de Weveraf59b2d2020-11-24 18:08:02 +0100109#include <__ranges/enable_borrowed_range.h>
Christopher Di Bella46f4bcf2021-06-10 18:40:21 +0000110#include <__ranges/enable_view.h>
zoecarverdd772db2021-05-06 13:19:13 -0700111#include <__ranges/ref_view.h>
zoecarvere3a4b182021-04-22 09:29:02 -0700112#include <__ranges/size.h>
zoecarverbd0551d2021-05-03 14:37:42 -0700113#include <__ranges/subrange.h>
zoecarver528b66d2021-04-30 15:24:28 -0700114#include <__ranges/view_interface.h>
Mark de Weveraf59b2d2020-11-24 18:08:02 +0100115#include <compare> // Required by the standard.
116#include <initializer_list> // Required by the standard.
117#include <iterator> // Required by the standard.
118#include <type_traits>
119#include <version>
120
121#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
122#pragma GCC system_header
123#endif
124
125_LIBCPP_PUSH_MACROS
126#include <__undef_macros>
127
128_LIBCPP_BEGIN_NAMESPACE_STD
129
130#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
131
132#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
133
134_LIBCPP_END_NAMESPACE_STD
135
136_LIBCPP_POP_MACROS
137
138#endif // _LIBCPP_RANGES