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 export namespace std {
12 inline namespace __cpo {
13 // [range.access], range access
14 using std::ranges::__cpo::begin;
15 using std::ranges::__cpo::cbegin;
16 using std::ranges::__cpo::cend;
17 using std::ranges::__cpo::crbegin;
18 using std::ranges::__cpo::crend;
19 using std::ranges::__cpo::end;
20 using std::ranges::__cpo::rbegin;
21 using std::ranges::__cpo::rend;
23 using std::ranges::__cpo::cdata;
24 using std::ranges::__cpo::data;
25 using std::ranges::__cpo::empty;
26 using std::ranges::__cpo::size;
27 using std::ranges::__cpo::ssize;
30 // [range.range], ranges
31 using std::ranges::range;
33 using std::ranges::enable_borrowed_range;
35 using std::ranges::borrowed_range;
37 // using std::ranges::const_iterator_t;
38 // using std::ranges::const_sentinel_t;
39 using std::ranges::iterator_t;
40 // using std::ranges::range_const_reference_t;
41 using std::ranges::range_common_reference_t;
42 using std::ranges::range_difference_t;
43 using std::ranges::range_reference_t;
44 using std::ranges::range_rvalue_reference_t;
45 using std::ranges::range_size_t;
46 using std::ranges::range_value_t;
47 using std::ranges::sentinel_t;
49 // [range.sized], sized ranges
50 using std::ranges::disable_sized_range;
51 using std::ranges::sized_range;
53 // [range.view], views
54 using std::ranges::enable_view;
55 using std::ranges::view;
56 using std::ranges::view_base;
58 // [range.refinements], other range refinements
59 using std::ranges::bidirectional_range;
60 using std::ranges::common_range;
61 // using std::ranges::constant_range;
62 using std::ranges::contiguous_range;
63 using std::ranges::forward_range;
64 using std::ranges::input_range;
65 using std::ranges::output_range;
66 using std::ranges::random_access_range;
67 using std::ranges::viewable_range;
69 // [view.interface], class template view_interface
70 using std::ranges::view_interface;
72 // [range.subrange], sub-ranges
73 using std::ranges::subrange;
74 using std::ranges::subrange_kind;
76 using std::ranges::get;
79 using std::ranges::get;
83 // [range.dangling], dangling iterator handling
84 using std::ranges::dangling;
86 // [range.elementsof], class template elements_of
87 // using std::ranges::elements_of;
89 using std::ranges::borrowed_iterator_t;
91 using std::ranges::borrowed_subrange_t;
93 #if _LIBCPP_STD_VER >= 23
94 // [range.utility.conv], range conversions
95 using std::ranges::to;
98 // [range.empty], empty view
99 using std::ranges::empty_view;
102 using std::ranges::views::empty;
105 // [range.single], single view
106 using std::ranges::single_view;
109 using std::ranges::views::single;
112 // [range.iota], iota view
113 using std::ranges::iota_view;
116 using std::ranges::views::iota;
119 #if _LIBCPP_STD_VER >= 23
120 // [range.repeat], repeat view
121 using std::ranges::repeat_view;
124 using std::ranges::views::repeat;
126 #endif // _LIBCPP_STD_VER >= 23
128 #ifndef _LIBCPP_HAS_NO_LOCALIZATION
129 // [range.istream], istream view
130 using std::ranges::basic_istream_view;
131 using std::ranges::istream_view;
132 # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
133 using std::ranges::wistream_view;
137 using std::ranges::views::istream;
139 #endif // _LIBCPP_HAS_NO_LOCALIZATION
141 // Note: This declaration not in the synopsis or explicitly in the wording.
142 // However it is needed for the range adaptors.
143 // [range.adaptor.object]/3
144 // The template parameter D for range_adaptor_closure may be an
145 // incomplete type. If an expression of type cv D is used as an operand
146 // to the | operator, D shall be complete and model
147 // derived_from<range_adaptor_closure<D>>. The behavior of an expression
148 // involving an object of type cv D as an operand to the | operator is
149 // undefined if overload resolution selects a program-defined operator|
151 // This is used internally in C++20 mode.
152 using std::ranges::operator|;
153 #if _LIBCPP_STD_VER >= 23
154 // [range.adaptor.object], range adaptor objects
155 using std::ranges::range_adaptor_closure;
158 // [range.all], all view
160 using std::ranges::views::all;
161 using std::ranges::views::all_t;
164 // [range.ref.view], ref view
165 using std::ranges::ref_view;
167 // [range.owning.view], owning view
168 using std::ranges::owning_view;
170 #if _LIBCPP_STD_VER >= 23
171 // [range.as.rvalue], as rvalue view
172 using std::ranges::as_rvalue_view;
175 using std::ranges::views::as_rvalue;
177 #endif // _LIBCPP_STD_VER >= 23
179 // [range.filter], filter view
180 using std::ranges::filter_view;
183 using std::ranges::views::filter;
186 // [range.transform], transform view
187 using std::ranges::transform_view;
190 using std::ranges::views::transform;
193 // [range.take], take view
194 using std::ranges::take_view;
197 using std::ranges::views::take;
200 // [range.take.while], take while view
201 using std::ranges::take_while_view;
204 using std::ranges::views::take_while;
207 // [range.drop], drop view
208 using std::ranges::drop_view;
211 using std::ranges::views::drop;
214 // [range.drop.while], drop while view
215 using std::ranges::drop_while_view;
218 using std::ranges::views::drop_while;
221 using std::ranges::join_view;
224 using std::ranges::views::join;
227 using std::ranges::join_with_view;
230 using std::ranges::views::join_with;
233 using std::ranges::lazy_split_view;
235 // [range.split], split view
236 using std::ranges::split_view;
239 using std::ranges::views::lazy_split;
240 using std::ranges::views::split;
243 // [range.counted], counted view
245 using std::ranges::views::counted;
248 // [range.common], common view
249 using std::ranges::common_view;
252 using std::ranges::views::common;
255 // [range.reverse], reverse view
256 using std::ranges::reverse_view;
259 using std::ranges::views::reverse;
262 // [range.as.const], as const view
264 using std::ranges::as_const_view;
267 using std::ranges::views::as_const;
270 // [range.elements], elements view
271 using std::ranges::elements_view;
273 using std::ranges::keys_view;
274 using std::ranges::values_view;
277 using std::ranges::views::elements;
278 using std::ranges::views::keys;
279 using std::ranges::views::values;
282 #if _LIBCPP_STD_VER >= 23
283 // [range.zip], zip view
284 using std::ranges::zip_view;
287 using std::ranges::views::zip;
289 #endif // _LIBCPP_STD_VER >= 23
292 // [range.zip.transform], zip transform view
293 using std::ranges::zip_transform_view;
296 using std::ranges::views::zip_transform;
299 using std::ranges::adjacent_view;
302 using std::ranges::views::adjacent;
303 using std::ranges::views::pairwise;
306 using std::ranges::adjacent_transform_view;
309 using std::ranges::views::adjacent_transform;
310 using std::ranges::views::pairwise_transform;
313 using std::ranges::chunk_view;
315 using std::ranges::chunk_view<V>;
318 using std::ranges::views::chunk;
321 using std::ranges::slide_view;
324 using std::ranges::views::slide;
328 #if _LIBCPP_STD_VER >= 23
329 // [range.chunk.by], chunk by view
330 using std::ranges::chunk_by_view;
333 using std::ranges::views::chunk_by;
335 #endif // _LIBCPP_STD_VER >= 23
338 // [range.stride], stride view
339 using std::ranges::stride_view;
342 using std::ranges::views::stride;
345 using std::ranges::cartesian_product_view;
348 using std::ranges::views::cartesian_product;
351 } // namespace ranges
353 namespace views = ranges::views;
355 using std::tuple_element;
356 using std::tuple_size;
358 #if _LIBCPP_STD_VER >= 23
359 using std::from_range;
360 using std::from_range_t;
361 #endif // _LIBCPP_STD_VER >= 23