// -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP_RANGES #define _LIBCPP_RANGES /* #include // see [compare.syn] #include // see [initializer.list.syn] #include // see [iterator.synopsis] namespace std::ranges { inline namespace unspecified { // [range.access], range access inline constexpr unspecified begin = unspecified; inline constexpr unspecified end = unspecified; inline constexpr unspecified cbegin = unspecified; inline constexpr unspecified cend = unspecified; inline constexpr unspecified size = unspecified; inline constexpr unspecified ssize = unspecified; } // [range.range], ranges template concept range = see below; template inline constexpr bool enable_borrowed_range = false; template using iterator_t = decltype(ranges::begin(declval())); template using sentinel_t = decltype(ranges::end(declval())); template using range_difference_t = iter_difference_t>; template using range_size_t = decltype(ranges::size(declval())); template using range_value_t = iter_value_t>; template using range_reference_t = iter_reference_t>; template using range_rvalue_reference_t = iter_rvalue_reference_t>; // [range.sized], sized ranges template inline constexpr bool disable_sized_range = false; template concept sized_range = ...; // [range.view], views template inline constexpr bool enable_view = ...; struct view_base { }; template concept view = ...; // [range.refinements], other range refinements template concept output_range = see below; template concept input_range = see below; template concept forward_range = see below; template concept bidirectional_range = see below; template concept random_access_range = see below; template concept contiguous_range = see below; template concept common_range = see below; template concept viewable_range = see below; // [view.interface], class template view_interface template requires is_class_v && same_as> class view_interface; // [range.subrange], sub-ranges enum class subrange_kind : bool { unsized, sized }; template S = I, subrange_kind K = see below> requires (K == subrange_kind::sized || !sized_sentinel_for) class subrange; template inline constexpr bool enable_borrowed_range> = true; // [range.dangling], dangling iterator handling struct dangling; template using borrowed_iterator_t = see below; template using borrowed_subrange_t = see below; // [range.empty], empty view template requires is_object_v class empty_view; template inline constexpr bool enable_borrowed_range> = true; namespace views { template inline constexpr empty_view empty{}; } // [range.all], all view namespace views { inline constexpr unspecified all = unspecified; template using all_t = decltype(all(declval())); } template requires is_object_v class ref_view; template inline constexpr bool enable_borrowed_range> = true; template requires see below class owning_view; template inline constexpr bool enable_borrowed_range> = enable_borrowed_range; // [range.filter], filter view template> Pred> requires view && is_object_v class filter_view; namespace views { inline constexpr unspecified filter = unspecified; } // [range.drop], drop view template class drop_view; template inline constexpr bool enable_borrowed_range> = enable_borrowed_range; // [range.transform], transform view template requires view && is_object_v && regular_invocable> && can-reference>> class transform_view; // [range.counted], counted view namespace views { inline constexpr unspecified counted = unspecified; } // [range.common], common view template requires (!common_range && copyable>) class common_view; // [range.reverse], reverse view template requires bidirectional_range class reverse_view; template inline constexpr bool enable_borrowed_range> = enable_borrowed_range; template inline constexpr bool enable_borrowed_range> = enable_borrowed_range; // [range.take], take view template class take_view; template inline constexpr bool enable_borrowed_range> = enable_borrowed_range; template requires is_object_v class single_view; template requires weakly-equality-comparable-with && copyable class iota_view; template inline constexpr bool enable_borrowed_range> = true; // [range.join], join view template requires view && input_range> class join_view; // [range.lazy.split], lazy split view template concept tiny-range = see below; // exposition only template requires view && view && indirectly_comparable, iterator_t, ranges::equal_to> && (forward_range || tiny-range) class lazy_split_view; namespace views { inline constexpr unspecified lazy_split = unspecified; } // [range.zip], zip view template requires (view && ...) && (sizeof...(Views) > 0) class zip_view; // C++2b template inline constexpr bool enable_borrowed_range> = // C++2b (enable_borrowed_range && ...); namespace views { inline constexpr unspecified zip = unspecified; } // C++2b } namespace std { namespace views = ranges::views; template struct tuple_size; template struct tuple_element; template struct tuple_size> : integral_constant {}; template struct tuple_element<0, ranges::subrange> { using type = I; }; template struct tuple_element<1, ranges::subrange> { using type = S; }; template struct tuple_element<0, const ranges::subrange> { using type = I; }; template struct tuple_element<1, const ranges::subrange> { using type = S; }; } */ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__ranges/access.h> #include <__ranges/all.h> #include <__ranges/common_view.h> #include <__ranges/concepts.h> #include <__ranges/counted.h> #include <__ranges/dangling.h> #include <__ranges/data.h> #include <__ranges/drop_view.h> #include <__ranges/empty.h> #include <__ranges/empty_view.h> #include <__ranges/enable_borrowed_range.h> #include <__ranges/enable_view.h> #include <__ranges/filter_view.h> #include <__ranges/iota_view.h> #include <__ranges/join_view.h> #include <__ranges/lazy_split_view.h> #include <__ranges/rbegin.h> #include <__ranges/ref_view.h> #include <__ranges/rend.h> #include <__ranges/reverse_view.h> #include <__ranges/single_view.h> #include <__ranges/size.h> #include <__ranges/subrange.h> #include <__ranges/take_view.h> #include <__ranges/transform_view.h> #include <__ranges/view_interface.h> #include <__ranges/views.h> #include <__ranges/zip_view.h> #include <__tuple> // TODO: has to export std::tuple_size. Replace this, once is granularized. #include // Required by the standard. #include // Required by the standard. #include // Required by the standard. #include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif #endif // _LIBCPP_RANGES