forked from OSchip/llvm-project
[libc++] Guard much of std::ranges under _LIBCPP_HAS_NO_INCOMPLETE_RANGES.
The logic here is that we are disabling *only* things in `std::ranges::`. Everything in `std::` is permitted, including `default_sentinel`, `contiguous_iterator`, `common_iterator`, `projected`, `swappable`, and so on. Then, we include anything from `std::ranges::` that is required in order to make those things work: `ranges::swap`, `ranges::swap_ranges`, `input_range`, `ranges::begin`, `ranges::iter_move`, and so on. But then that's all. Everything else (including notably all of the "views" and the `std::views` namespace itself) is still locked up behind `_LIBCPP_HAS_NO_INCOMPLETE_RANGES`. Differential Revision: https://reviews.llvm.org/D118736
This commit is contained in:
parent
149ad3d554
commit
53406fb691
|
@ -20,7 +20,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
|
@ -47,7 +47,7 @@ struct in_in_out_result {
|
|||
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
|
@ -47,7 +47,7 @@ struct in_out_result {
|
|||
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_CONCEPTS
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
|
@ -67,6 +67,6 @@ inline namespace __cpo {
|
|||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RANGES
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
#endif // _LIBCPP___ALGORITHM_RANGES_MIN_ELEMENT_H
|
||||
|
|
|
@ -147,7 +147,7 @@ template <>
|
|||
_LIBCPP_AVAILABILITY_FILESYSTEM
|
||||
inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::directory_iterator> = true;
|
||||
|
||||
#endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ template <>
|
|||
_LIBCPP_AVAILABILITY_FILESYSTEM
|
||||
inline constexpr bool _VSTD::ranges::enable_view<_VSTD_FS::recursive_directory_iterator> = true;
|
||||
|
||||
#endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
struct equal_to {
|
||||
|
@ -90,7 +91,7 @@ struct greater_equal {
|
|||
};
|
||||
|
||||
} // namespace ranges
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ void advance(_InputIter& __i, _Distance __orig_n) {
|
|||
_VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
|
||||
}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [range.iter.op.advance]
|
||||
|
||||
|
@ -193,7 +193,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ distance(_InputIter __first, _InputIter __last)
|
|||
return _VSTD::__distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
|
||||
}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [range.iter.op.distance]
|
||||
|
||||
|
@ -100,7 +100,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
template <class _Container>
|
||||
using __insert_iterator_iter_t = ranges::iterator_t<_Container>;
|
||||
#else
|
||||
|
|
|
@ -86,7 +86,7 @@ template<__dereferenceable _Tp>
|
|||
requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __can_reference; }
|
||||
using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<_Tp&>()));
|
||||
|
||||
#endif // !_LIBCPP_HAS_NO_CONCEPTS
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <__iterator/iter_move.h>
|
||||
#include <__iterator/iterator_traits.h>
|
||||
#include <__iterator/readable_traits.h>
|
||||
#include <__ranges/access.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <__utility/move.h>
|
||||
#include <concepts>
|
||||
|
|
|
@ -35,7 +35,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
|||
return __x;
|
||||
}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [range.iter.op.next]
|
||||
|
||||
|
@ -79,7 +79,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
|||
return __x;
|
||||
}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [range.iter.op.prev]
|
||||
|
||||
|
@ -71,7 +71,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
// [special.mem.concepts]
|
||||
|
@ -59,7 +60,8 @@ concept __nothrow_forward_range =
|
|||
__nothrow_forward_iterator<iterator_t<_Rp>>;
|
||||
|
||||
} // namespace ranges
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
namespace ranges {
|
||||
|
||||
// construct_at
|
||||
|
@ -117,7 +117,7 @@ inline namespace __cpo {
|
|||
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
// uninitialized_default_construct
|
||||
|
@ -309,7 +310,8 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
|
||||
} // namespace ranges
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges::views {
|
||||
|
||||
|
@ -75,7 +75,7 @@ using all_t = decltype(views::all(declval<_Range>()));
|
|||
|
||||
} // namespace ranges::views
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
|
@ -128,7 +128,7 @@ inline namespace __cpo {
|
|||
} // namespace views
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -35,13 +35,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
// [range.range]
|
||||
|
||||
template <class _Tp>
|
||||
concept range = requires(_Tp& __t) {
|
||||
ranges::begin(__t); // sometimes equality-preserving
|
||||
ranges::end(__t);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
concept input_range = range<_Tp> && input_iterator<iterator_t<_Tp>>;
|
||||
|
||||
template<class _Range>
|
||||
concept borrowed_range = range<_Range> &&
|
||||
(is_lvalue_reference_v<_Range> || enable_borrowed_range<remove_cvref_t<_Range>>);
|
||||
|
@ -63,6 +68,8 @@ namespace ranges {
|
|||
template <range _Rp>
|
||||
using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<_Rp>>;
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [range.sized]
|
||||
template <class _Tp>
|
||||
concept sized_range = range<_Tp> && requires(_Tp& __t) { ranges::size(__t); };
|
||||
|
@ -93,9 +100,6 @@ namespace ranges {
|
|||
template <class _Rp, class _Tp>
|
||||
concept output_range = range<_Rp> && output_iterator<iterator_t<_Rp>, _Tp>;
|
||||
|
||||
template <class _Tp>
|
||||
concept input_range = range<_Tp> && input_iterator<iterator_t<_Tp>>;
|
||||
|
||||
template <class _Tp>
|
||||
concept forward_range = input_range<_Tp> && forward_iterator<iterator_t<_Tp>>;
|
||||
|
||||
|
@ -131,6 +135,8 @@ namespace ranges {
|
|||
(is_lvalue_reference_v<_Tp> ||
|
||||
(movable<remove_reference_t<_Tp>> && !__is_std_initializer_list<remove_cvref_t<_Tp>>))));
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// __copyable_box allows turning a type that is copy-constructible (but maybe not copy-assignable) into
|
||||
// a type that is both copy-constructible and copy-assignable. It does that by introducing an empty state
|
||||
|
@ -171,7 +171,7 @@ namespace ranges {
|
|||
};
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges::views {
|
||||
|
||||
|
@ -74,7 +74,7 @@ inline namespace __cpo {
|
|||
|
||||
} // namespace ranges::views
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ using borrowed_iterator_t = _If<borrowed_range<_Rp>, iterator_t<_Rp>, dangling>;
|
|||
// borrowed_subrange_t defined in <__ranges/subrange.h>
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !_LIBCPP_HAS_NO_CONCEPTS
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [range.prim.data]
|
||||
|
||||
|
@ -99,7 +99,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<view _View>
|
||||
|
@ -120,7 +120,7 @@ public:
|
|||
inline constexpr bool enable_borrowed_range<drop_view<_Tp>> = enable_borrowed_range<_Tp>;
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [range.prim.empty]
|
||||
|
||||
|
@ -75,7 +75,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<class _Tp>
|
||||
|
@ -38,7 +38,7 @@ namespace ranges {
|
|||
inline constexpr bool enable_borrowed_range<empty_view<_Tp>> = true;
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,8 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
namespace ranges
|
||||
{
|
||||
namespace ranges {
|
||||
|
||||
// [range.range], ranges
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ inline constexpr bool enable_view = derived_from<_Tp, view_base> ||
|
|||
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !_LIBCPP_HAS_NO_CONCEPTS
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<class _Int>
|
||||
|
@ -401,7 +401,7 @@ inline namespace __cpo {
|
|||
} // namespace views
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<class>
|
||||
|
@ -343,7 +343,7 @@ namespace ranges {
|
|||
|
||||
#undef _CONSTEXPR_TERNARY
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
// __non_propagating_cache is a helper type that allows storing an optional value in it,
|
||||
|
@ -107,7 +107,7 @@ namespace ranges {
|
|||
struct __empty_cache { };
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<range _Rp>
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// CRTP base that one can derive from in order to be considered a range adaptor closure
|
||||
// by the library. When deriving from this class, a pipe operator will be provided to
|
||||
|
@ -66,7 +66,7 @@ struct __range_adaptor_closure {
|
|||
{ return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1))); }
|
||||
};
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [ranges.access.rbegin]
|
||||
|
||||
|
@ -123,7 +123,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<range _Range>
|
||||
|
@ -79,7 +79,7 @@ public:
|
|||
inline constexpr bool enable_borrowed_range<ref_view<_Tp>> = true;
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
// [range.access.rend]
|
||||
|
||||
|
@ -127,7 +127,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<view _View>
|
||||
|
@ -183,7 +183,7 @@ namespace ranges {
|
|||
} // namespace views
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<copy_constructible _Tp>
|
||||
|
@ -74,7 +74,7 @@ namespace ranges {
|
|||
single_view(_Tp) -> single_view<_Tp>;
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<class>
|
||||
|
@ -128,7 +128,7 @@ inline namespace __cpo {
|
|||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<class _From, class _To>
|
||||
|
@ -282,7 +282,7 @@ struct tuple_element<1, const ranges::subrange<_Ip, _Sp, _Kp>> {
|
|||
using type = _Sp;
|
||||
};
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ _LIBCPP_PUSH_MACROS
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
template<view _View>
|
||||
|
@ -176,7 +176,7 @@ public:
|
|||
inline constexpr bool enable_borrowed_range<take_view<_Tp>> = enable_borrowed_range<_Tp>;
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
|
@ -433,7 +433,7 @@ inline namespace __cpo {
|
|||
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
namespace ranges {
|
||||
|
||||
|
@ -188,7 +188,7 @@ public:
|
|||
|
||||
} // namespace ranges
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -230,11 +230,6 @@ namespace std {
|
|||
}
|
||||
*/
|
||||
|
||||
// Make sure all feature-test macros are available.
|
||||
#include <version>
|
||||
// Enable the contents of the header only when libc++ was built with LIBCXX_ENABLE_INCOMPLETE_FEATURES.
|
||||
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
#include <__config>
|
||||
#include <__ranges/access.h>
|
||||
#include <__ranges/all.h>
|
||||
|
@ -265,11 +260,10 @@ namespace std {
|
|||
#include <initializer_list> // Required by the standard.
|
||||
#include <iterator> // Required by the standard.
|
||||
#include <type_traits>
|
||||
#include <version>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
#endif // _LIBCPP_RANGES
|
||||
|
|
|
@ -170,7 +170,7 @@ struct __is_std_span : false_type {};
|
|||
template <class _Tp, size_t _Sz>
|
||||
struct __is_std_span<span<_Tp, _Sz>> : true_type {};
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
template <class _Range, class _ElementType>
|
||||
concept __span_compatible_range =
|
||||
ranges::contiguous_range<_Range> &&
|
||||
|
@ -234,7 +234,7 @@ public:
|
|||
_LIBCPP_ASSERT(__last - __first == _Extent,
|
||||
"invalid range in span's constructor (iterator, sentinel): last - first != extent");
|
||||
}
|
||||
#endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t<element_type> (&__arr)[_Extent]) noexcept : __data{__arr} {}
|
||||
|
||||
|
@ -248,13 +248,13 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
template <__span_compatible_range<element_type> _Range>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit span(_Range&& __r) : __data{ranges::data(__r)} {
|
||||
_LIBCPP_ASSERT(ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)");
|
||||
}
|
||||
#endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
template <class _OtherElementType>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -418,7 +418,7 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(_It __first, _End __last)
|
||||
: __data(_VSTD::to_address(__first)), __size(__last - __first) {}
|
||||
#endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
template <size_t _Sz>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -434,11 +434,11 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {}
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
template <__span_compatible_range<element_type> _Range>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(_Range&& __r) : __data(ranges::data(__r)), __size{ranges::size(__r)} {}
|
||||
# endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
|
||||
template <class _OtherElementType, size_t _OtherExtent>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -565,10 +565,9 @@ auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept
|
|||
{ return __s.__as_writable_bytes(); }
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
// Deduction guides
|
||||
template<contiguous_iterator _It, class _EndOrSize>
|
||||
span(_It, _EndOrSize) -> span<remove_reference_t<iter_reference_t<_It>>>;
|
||||
#endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
template<class _Tp, size_t _Sz>
|
||||
span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>;
|
||||
|
@ -579,7 +578,7 @@ template<class _Tp, size_t _Sz>
|
|||
template<class _Tp, size_t _Sz>
|
||||
span(const array<_Tp, _Sz>&) -> span<const _Tp, _Sz>;
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
template<ranges::contiguous_range _Range>
|
||||
span(_Range&&) -> span<remove_reference_t<ranges::range_reference_t<_Range>>>;
|
||||
#endif
|
||||
|
|
|
@ -294,9 +294,9 @@ public:
|
|||
{
|
||||
_LIBCPP_ASSERT((__end - __begin) >= 0, "std::string_view::string_view(iterator, sentinel) received invalid range");
|
||||
}
|
||||
#endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
#if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
template <class _Range>
|
||||
requires (
|
||||
!is_same_v<remove_cvref_t<_Range>, basic_string_view> &&
|
||||
|
@ -720,10 +720,10 @@ inline constexpr bool ranges::enable_borrowed_range<basic_string_view<_CharT, _T
|
|||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
template <contiguous_iterator _It, sized_sentinel_for<_It> _End>
|
||||
basic_string_view(_It, _End) -> basic_string_view<iter_value_t<_It>>;
|
||||
#endif
|
||||
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
|
||||
#if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
|
||||
template <ranges::contiguous_range _Range>
|
||||
basic_string_view(_Range) -> basic_string_view<ranges::range_value_t<_Range>>;
|
||||
#endif
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template<class I>
|
||||
// concept __nothrow_forward_iterator;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template<class I>
|
||||
// concept __nothrow_input_iterator;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template<class S, class I>
|
||||
// concept __nothrow_sentinel_for;
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// REQUIRES: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// Test that _LIBCPP_HAS_NO_INCOMPLETE_RANGES disables the std::ranges namespace.
|
||||
|
||||
#include <algorithm>
|
||||
#include <concepts>
|
||||
#include <filesystem>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <numeric>
|
||||
#include <ranges>
|
||||
#include <span>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
namespace ranges {
|
||||
int output_range;
|
||||
int data;
|
||||
int size;
|
||||
int prev;
|
||||
int next;
|
||||
int distance;
|
||||
int take_view;
|
||||
int drop_view;
|
||||
int transform_view;
|
||||
int filter_view;
|
||||
int join_view;
|
||||
int views; // this entire namespace should be absent
|
||||
}
|
||||
_LIBCPP_END_NAMESPACE_STD
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// Test the libc++-specific behavior that we handle the IFNDR case for ranges::end
|
||||
// by being SFINAE-friendly.
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
#include <ranges>
|
||||
#include <concepts>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
#include <ranges>
|
||||
#include <iterator>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template <class I1, class I2>
|
||||
// struct in_in_result;
|
||||
|
|
|
@ -86,6 +86,7 @@ void test_std_array() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
||||
void test_range_std_container() {
|
||||
{
|
||||
std::string str{"ABCDE"};
|
||||
|
@ -103,13 +104,17 @@ void test_range_std_container() {
|
|||
assert(s.data() == str.data());
|
||||
}
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
test_iterator_sentinel();
|
||||
test_c_array();
|
||||
test_std_array();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
||||
test_range_std_container();
|
||||
#endif // _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::advance
|
||||
// Make sure we're SFINAE-friendly when the template argument constraints are not met.
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::advance(it, n)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::advance(it, n, sent)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::advance(it, sent)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template<class I, sentinel_for<I> S>
|
||||
// requires (!sized_sentinel_for<S, I>)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template<class I, sentinel_for<I> S>
|
||||
// requires (!sized_sentinel_for<S, I>)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::next
|
||||
// Make sure we're SFINAE-friendly when the template argument constraints are not met.
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::next(it)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::next(it, n)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::next(it, n, bound)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::next(it, bound)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::prev
|
||||
// Make sure we're SFINAE-friendly when the template argument constraints are not met.
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::prev(it)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::prev(it, n)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// ranges::prev(it, n, bound)
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// Test the [[nodiscard]] extension in libc++.
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template<common_with<I> I2>
|
||||
// friend constexpr bool operator==(
|
||||
|
|
|
@ -15,9 +15,7 @@
|
|||
// common_iterator& operator=(const common_iterator<I2, S2>& x);
|
||||
|
||||
#include <iterator>
|
||||
#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
||||
#include <ranges>
|
||||
#endif
|
||||
#include <cassert>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
@ -56,7 +54,6 @@ void test() {
|
|||
assert(*commonIter2 == 2);
|
||||
assert(commonIter1 == commonIter2);
|
||||
}
|
||||
#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
||||
{
|
||||
auto iter1 = random_access_iterator<int*>(buffer);
|
||||
auto commonIter1 = std::common_iterator<decltype(iter1), sentinel_type<int*>>(iter1);
|
||||
|
@ -75,15 +72,14 @@ void test() {
|
|||
assert(*commonIter2 == 2);
|
||||
assert(commonIter1 == commonIter2);
|
||||
|
||||
assert(std::ranges::next(commonIter1, 6) != commonSent1);
|
||||
assert(std::ranges::next(commonIter1, 6) == commonSent2);
|
||||
assert(std::next(commonIter1, 6) != commonSent1);
|
||||
assert(std::next(commonIter1, 6) == commonSent2);
|
||||
|
||||
commonSent1 = commonSent2;
|
||||
|
||||
assert(std::ranges::next(commonIter1, 6) == commonSent1);
|
||||
assert(std::ranges::next(commonIter1, 6) == commonSent2);
|
||||
assert(std::next(commonIter1, 6) == commonSent1);
|
||||
assert(std::next(commonIter1, 6) == commonSent2);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
auto iter1 = assignable_iterator<int*>(buffer);
|
||||
auto iter2 = forward_iterator<int*>(buffer + 1);
|
||||
|
@ -102,17 +98,13 @@ void test() {
|
|||
assert(*commonIter2 == 2);
|
||||
assert(commonIter1 == commonIter2);
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
||||
assert(std::ranges::next(commonIter1, 6) != commonSent1);
|
||||
assert(std::ranges::next(commonIter1, 6) == commonSent2);
|
||||
#endif
|
||||
assert(std::next(commonIter1, 6) != commonSent1);
|
||||
assert(std::next(commonIter1, 6) == commonSent2);
|
||||
|
||||
commonSent1 = commonSent2;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_INCOMPLETE_RANGES
|
||||
assert(std::ranges::next(commonIter1, 6) == commonSent1);
|
||||
assert(std::ranges::next(commonIter1, 6) == commonSent2);
|
||||
#endif
|
||||
assert(std::next(commonIter1, 6) == commonSent1);
|
||||
assert(std::next(commonIter1, 6) == commonSent2);
|
||||
|
||||
commonIter1 = commonSent1;
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// std::ranges::begin
|
||||
// std::ranges::cbegin
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// std::ranges::end
|
||||
// std::ranges::cend
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template<class T>
|
||||
// concept borrowed_range;
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// template<class T>
|
||||
// concept borrowed_range;
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <ranges>
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <string_view>
|
||||
|
||||
|
@ -17,7 +16,6 @@
|
|||
#include <string_view>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <ranges>
|
||||
|
||||
#include "make_string.h"
|
||||
#include "test_iterators.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <string_view>
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <functional>
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <functional>
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <functional>
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <functional>
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <functional>
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
||||
// UNSUPPORTED: libcpp-no-concepts
|
||||
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
|
||||
|
||||
// <functional>
|
||||
|
||||
|
|
|
@ -491,7 +491,8 @@ private:
|
|||
const T *current_;
|
||||
};
|
||||
|
||||
#ifdef TEST_SUPPORTS_RANGES
|
||||
#if TEST_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
template <class It>
|
||||
class cpp20_input_iterator
|
||||
{
|
||||
|
@ -676,7 +677,8 @@ private:
|
|||
difference_type stride_count_ = 0;
|
||||
difference_type stride_displacement_ = 0;
|
||||
};
|
||||
#endif // TEST_SUPPORTS_RANGES
|
||||
|
||||
#endif // TEST_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
|
||||
#if TEST_STD_VER > 17
|
||||
template <class It>
|
||||
|
|
|
@ -243,10 +243,6 @@
|
|||
#define LIBCPP_ONLY(...) static_assert(true, "")
|
||||
#endif
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
|
||||
#define TEST_SUPPORTS_RANGES
|
||||
#endif
|
||||
|
||||
#define TEST_IGNORE_NODISCARD (void)
|
||||
|
||||
namespace test_macros_detail {
|
||||
|
|
Loading…
Reference in New Issue