xref: /freebsd/contrib/llvm-project/libcxx/modules/std/ranges.inc (revision 6580f5c38dd5b01aeeaed16b370f1a12423437f0)
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
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
10export namespace std {
11  namespace ranges {
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;
22
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;
28    } // namespace __cpo
29
30    // [range.range], ranges
31    using std::ranges::range;
32
33    using std::ranges::enable_borrowed_range;
34
35    using std::ranges::borrowed_range;
36
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;
48
49    // [range.sized], sized ranges
50    using std::ranges::disable_sized_range;
51    using std::ranges::sized_range;
52
53    // [range.view], views
54    using std::ranges::enable_view;
55    using std::ranges::view;
56    using std::ranges::view_base;
57
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;
68
69    // [view.interface], class template view_­interface
70    using std::ranges::view_interface;
71
72    // [range.subrange], sub-ranges
73    using std::ranges::subrange;
74    using std::ranges::subrange_kind;
75
76    using std::ranges::get;
77  } // namespace ranges
78
79  using std::ranges::get;
80
81  namespace ranges {
82
83    // [range.dangling], dangling iterator handling
84    using std::ranges::dangling;
85
86    // [range.elementsof], class template elements_­of
87    // using std::ranges::elements_of;
88
89    using std::ranges::borrowed_iterator_t;
90
91    using std::ranges::borrowed_subrange_t;
92
93#if _LIBCPP_STD_VER >= 23
94    // [range.utility.conv], range conversions
95    using std::ranges::to;
96#endif
97
98    // [range.empty], empty view
99    using std::ranges::empty_view;
100
101    namespace views {
102      using std::ranges::views::empty;
103    }
104
105    // [range.single], single view
106    using std::ranges::single_view;
107
108    namespace views {
109      using std::ranges::views::single;
110    } // namespace views
111
112    // [range.iota], iota view
113    using std::ranges::iota_view;
114
115    namespace views {
116      using std::ranges::views::iota;
117    } // namespace views
118
119#if _LIBCPP_STD_VER >= 23
120    // [range.repeat], repeat view
121    using std::ranges::repeat_view;
122
123    namespace views {
124      using std::ranges::views::repeat;
125    } // namespace views
126#endif // _LIBCPP_STD_VER >= 23
127
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;
134#  endif
135
136    namespace views {
137      using std::ranges::views::istream;
138    }
139#endif // _LIBCPP_HAS_NO_LOCALIZATION
140
141    // [range.adaptor.object], range adaptor objects
142    // using std::ranges::range_adaptor_closure;
143
144    // [range.all], all view
145    namespace views {
146      using std::ranges::views::all;
147      using std::ranges::views::all_t;
148    } // namespace views
149
150    // [range.ref.view], ref view
151    using std::ranges::ref_view;
152
153    // [range.owning.view], owning view
154    using std::ranges::owning_view;
155
156#if _LIBCPP_STD_VER >= 23
157    // [range.as.rvalue], as rvalue view
158    using std::ranges::as_rvalue_view;
159
160    namespace views {
161      using std::ranges::views::as_rvalue;
162    } // namespace views
163#endif // _LIBCPP_STD_VER >= 23
164
165    // [range.filter], filter view
166    using std::ranges::filter_view;
167
168    namespace views {
169      using std::ranges::views::filter;
170    } // namespace views
171
172    // [range.transform], transform view
173    using std::ranges::transform_view;
174
175    namespace views {
176      using std::ranges::views::transform;
177    } // namespace views
178
179    // [range.take], take view
180    using std::ranges::take_view;
181
182    namespace views {
183      using std::ranges::views::take;
184    } // namespace views
185
186    // [range.take.while], take while view
187    using std::ranges::take_while_view;
188
189    namespace views {
190      using std::ranges::views::take_while;
191    } // namespace views
192
193    // [range.drop], drop view
194    using std::ranges::drop_view;
195
196    namespace views {
197      using std::ranges::views::drop;
198    } // namespace views
199
200    // [range.drop.while], drop while view
201    using std::ranges::drop_while_view;
202
203    namespace views {
204      using std::ranges::views::drop_while;
205    } // namespace views
206
207    using std::ranges::join_view;
208
209    namespace views {
210      using std::ranges::views::join;
211    } // namespace views
212#if 0
213    using std::ranges::join_with_view;
214
215    namespace views {
216      using std::ranges::views::join_with;
217    } // namespace views
218#endif
219    using std::ranges::lazy_split_view;
220
221    // [range.split], split view
222    using std::ranges::split_view;
223
224    namespace views {
225      using std::ranges::views::lazy_split;
226      using std::ranges::views::split;
227    } // namespace views
228
229    // [range.counted], counted view
230    namespace views {
231      using std::ranges::views::counted;
232    } // namespace views
233
234    // [range.common], common view
235    using std::ranges::common_view;
236
237    namespace views {
238      using std::ranges::views::common;
239    } // namespace views
240
241    // [range.reverse], reverse view
242    using std::ranges::reverse_view;
243
244    namespace views {
245      using std::ranges::views::reverse;
246    } // namespace views
247
248    // [range.as.const], as const view
249#if 0
250    using std::ranges::as_const_view;
251
252    namespace views {
253      using std::ranges::views::as_const;
254    } // namespace views
255#endif
256    // [range.elements], elements view
257    using std::ranges::elements_view;
258
259    using std::ranges::keys_view;
260    using std::ranges::values_view;
261
262    namespace views {
263      using std::ranges::views::elements;
264      using std::ranges::views::keys;
265      using std::ranges::views::values;
266    } // namespace views
267
268#if _LIBCPP_STD_VER >= 23
269    // [range.zip], zip view
270    using std::ranges::zip_view;
271
272    namespace views {
273      using std::ranges::views::zip;
274    } // namespace views
275#endif // _LIBCPP_STD_VER >= 23
276
277#if 0
278    // [range.zip.transform], zip transform view
279    using std::ranges::zip_transform_view;
280
281    namespace views {
282      using std::ranges::views::zip_transform;
283    }
284
285    using std::ranges::adjacent_view;
286
287    namespace views {
288      using std::ranges::views::adjacent;
289      using std::ranges::views::pairwise;
290    } // namespace views
291
292    using std::ranges::adjacent_transform_view;
293
294    namespace views {
295      using std::ranges::views::adjacent_transform;
296      using std::ranges::views::pairwise_transform;
297    } // namespace views
298
299    using std::ranges::chunk_view;
300
301    using std::ranges::chunk_view<V>;
302
303    namespace views {
304      using std::ranges::views::chunk;
305    }
306
307    using std::ranges::slide_view;
308
309    namespace views {
310      using std::ranges::views::slide;
311    }
312#endif
313
314#if _LIBCPP_STD_VER >= 23
315    // [range.chunk.by], chunk by view
316    using std::ranges::chunk_by_view;
317
318    namespace views {
319      using std::ranges::views::chunk_by;
320    }
321#endif // _LIBCPP_STD_VER >= 23
322
323#if 0
324    // [range.stride], stride view
325    using std::ranges::stride_view;
326
327    namespace views {
328      using std::ranges::views::stride;
329    }
330
331    using std::ranges::cartesian_product_view;
332
333    namespace views {
334      using std::ranges::views::cartesian_product;
335    }
336#endif
337  } // namespace ranges
338
339  namespace views = ranges::views;
340
341  using std::tuple_element;
342  using std::tuple_size;
343
344#if _LIBCPP_STD_VER >= 23
345  using std::from_range;
346  using std::from_range_t;
347#endif // _LIBCPP_STD_VER >= 23
348} // namespace std
349