blob: 90711cb7d05c1e81a238b75b813e307012ff7884 [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;
zoecarverb9f7b7a2021-06-24 11:05:50 -070097
98 // [range.drop], drop view
99 template<view V>
100 class drop_view;
101
102 template<class T>
103 inline constexpr bool enable_borrowed_range<drop_view<T>> = enable_borrowed_range<T>;
zoecarverae914482021-07-09 10:12:16 -0700104
105 // [range.transform], transform view
106 template<input_range V, copy_constructible F>
107 requires view<V> && is_object_v<F> &&
108 regular_invocable<F&, range_reference_t<V>> &&
109 can-reference<invoke_result_t<F&, range_reference_t<V>>>
110 class transform_view;
111
Mark de Weveraf59b2d2020-11-24 18:08:02 +0100112}
113
114*/
115
116#include <__config>
Christopher Di Bella66ce1292021-04-11 05:08:32 +0000117#include <__ranges/access.h>
zoecarver982808d2021-05-06 15:31:45 -0700118#include <__ranges/all.h>
Christopher Di Bella9db3ef22021-04-11 17:40:30 +0000119#include <__ranges/concepts.h>
zoecarver2fbc4d22021-04-23 15:22:18 -0700120#include <__ranges/data.h>
zoecarver545d1d42021-05-06 17:39:53 -0700121#include <__ranges/drop_view.h>
zoecarver85d69332021-04-23 12:34:22 -0700122#include <__ranges/empty.h>
zoecarver671223d2021-05-26 14:25:02 -0700123#include <__ranges/empty_view.h>
Mark de Weveraf59b2d2020-11-24 18:08:02 +0100124#include <__ranges/enable_borrowed_range.h>
Christopher Di Bella46f4bcf2021-06-10 18:40:21 +0000125#include <__ranges/enable_view.h>
zoecarverdd772db2021-05-06 13:19:13 -0700126#include <__ranges/ref_view.h>
zoecarvere3a4b182021-04-22 09:29:02 -0700127#include <__ranges/size.h>
zoecarverbd0551d2021-05-03 14:37:42 -0700128#include <__ranges/subrange.h>
zoecarverae914482021-07-09 10:12:16 -0700129#include <__ranges/transform_view.h>
zoecarver528b66d2021-04-30 15:24:28 -0700130#include <__ranges/view_interface.h>
Mark de Weveraf59b2d2020-11-24 18:08:02 +0100131#include <compare> // Required by the standard.
132#include <initializer_list> // Required by the standard.
133#include <iterator> // Required by the standard.
134#include <type_traits>
135#include <version>
136
137#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
138#pragma GCC system_header
139#endif
140
141_LIBCPP_PUSH_MACROS
142#include <__undef_macros>
143
144_LIBCPP_BEGIN_NAMESPACE_STD
145
146#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
147
148#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES)
149
150_LIBCPP_END_NAMESPACE_STD
151
152_LIBCPP_POP_MACROS
153
154#endif // _LIBCPP_RANGES