Mark de Wever | af59b2d | 2020-11-24 18:08:02 +0100 | [diff] [blame] | 1 | // -*- 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 | |
| 19 | namespace std::ranges { |
Christopher Di Bella | 66ce129 | 2021-04-11 05:08:32 +0000 | [diff] [blame] | 20 | 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; |
| 26 | } |
| 27 | |
Mark de Wever | af59b2d | 2020-11-24 18:08:02 +0100 | [diff] [blame] | 28 | // [range.range], ranges |
| 29 | template<class T> |
Christopher Di Bella | 9db3ef2 | 2021-04-11 17:40:30 +0000 | [diff] [blame] | 30 | concept range = see below; |
| 31 | |
| 32 | template<class T> |
Mark de Wever | af59b2d | 2020-11-24 18:08:02 +0100 | [diff] [blame] | 33 | inline constexpr bool enable_borrowed_range = false; |
Christopher Di Bella | 66ce129 | 2021-04-11 05:08:32 +0000 | [diff] [blame] | 34 | |
| 35 | template<class T> |
| 36 | using iterator_t = decltype(ranges::begin(declval<T&>())); |
Christopher Di Bella | 9db3ef2 | 2021-04-11 17:40:30 +0000 | [diff] [blame] | 37 | template<class T> |
| 38 | using iterator_t = decltype(ranges::begin(declval<T&>())); |
| 39 | template<range R> |
| 40 | using sentinel_t = decltype(ranges::end(declval<R&>())); |
| 41 | template<range R> |
| 42 | using range_difference_t = iter_difference_t<iterator_t<R>>; |
| 43 | template<range R> |
| 44 | using range_value_t = iter_value_t<iterator_t<R>>; |
| 45 | template<range R> |
| 46 | using range_reference_t = iter_reference_t<iterator_t<R>>; |
| 47 | template<range R> |
| 48 | using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>; |
| 49 | |
| 50 | // [range.refinements], other range refinements |
Christopher Di Bella | 8250c63 | 2021-04-11 19:04:52 +0000 | [diff] [blame^] | 51 | template<class T> |
| 52 | concept input_range = see below; |
| 53 | |
Christopher Di Bella | 9db3ef2 | 2021-04-11 17:40:30 +0000 | [diff] [blame] | 54 | template <class _Tp> |
| 55 | concept common_range = see below; |
Mark de Wever | af59b2d | 2020-11-24 18:08:02 +0100 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | */ |
| 59 | |
| 60 | #include <__config> |
Christopher Di Bella | 66ce129 | 2021-04-11 05:08:32 +0000 | [diff] [blame] | 61 | #include <__ranges/access.h> |
Christopher Di Bella | 9db3ef2 | 2021-04-11 17:40:30 +0000 | [diff] [blame] | 62 | #include <__ranges/concepts.h> |
Mark de Wever | af59b2d | 2020-11-24 18:08:02 +0100 | [diff] [blame] | 63 | #include <__ranges/enable_borrowed_range.h> |
| 64 | #include <compare> // Required by the standard. |
| 65 | #include <initializer_list> // Required by the standard. |
| 66 | #include <iterator> // Required by the standard. |
| 67 | #include <type_traits> |
| 68 | #include <version> |
| 69 | |
| 70 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 71 | #pragma GCC system_header |
| 72 | #endif |
| 73 | |
| 74 | _LIBCPP_PUSH_MACROS |
| 75 | #include <__undef_macros> |
| 76 | |
| 77 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 78 | |
| 79 | #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES) |
| 80 | |
| 81 | #endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_RANGES) |
| 82 | |
| 83 | _LIBCPP_END_NAMESPACE_STD |
| 84 | |
| 85 | _LIBCPP_POP_MACROS |
| 86 | |
| 87 | #endif // _LIBCPP_RANGES |