diff options
Diffstat (limited to 'libcxx/include/span')
| -rw-r--r-- | libcxx/include/span | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libcxx/include/span b/libcxx/include/span index d33ad09a388f..bd11330e69d9 100644 --- a/libcxx/include/span +++ b/libcxx/include/span @@ -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_RANGES) +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) template <class _Range, class _ElementType> concept __span_compatible_range = ranges::contiguous_range<_Range> && @@ -210,7 +210,7 @@ public: constexpr span (const span&) noexcept = default; constexpr span& operator=(const span&) noexcept = default; -#if !defined(_LIBCPP_HAS_NO_RANGES) +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) template <class _It, enable_if_t<contiguous_iterator<_It> && is_convertible_v<remove_reference_t<iter_reference_t<_It>>(*)[], element_type (*)[]>, @@ -248,7 +248,7 @@ public: _LIBCPP_INLINE_VISIBILITY constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {} -#if !defined(_LIBCPP_HAS_NO_RANGES) +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) template <__span_compatible_range<element_type> _Range> _LIBCPP_INLINE_VISIBILITY constexpr explicit span(_Range&& __r) : __data{ranges::data(__r)} { @@ -401,7 +401,7 @@ public: constexpr span (const span&) noexcept = default; constexpr span& operator=(const span&) noexcept = default; -#if !defined(_LIBCPP_HAS_NO_RANGES) +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) template <class _It, enable_if_t<contiguous_iterator<_It> && is_convertible_v<remove_reference_t<iter_reference_t<_It> > (*)[], element_type (*)[]>, @@ -434,7 +434,7 @@ public: _LIBCPP_INLINE_VISIBILITY constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} -#if !defined(_LIBCPP_HAS_NO_RANGES) +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) template <__span_compatible_range<element_type> _Range> _LIBCPP_INLINE_VISIBILITY constexpr span(_Range&& __r) : __data(ranges::data(__r)), __size{ranges::size(__r)} {} @@ -543,13 +543,13 @@ private: size_type __size; }; -#if !defined(_LIBCPP_HAS_NO_RANGES) +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) template <class _Tp, size_t _Extent> inline constexpr bool ranges::enable_borrowed_range<span<_Tp, _Extent> > = true; template <class _ElementType, size_t _Extent> inline constexpr bool ranges::enable_view<span<_ElementType, _Extent>> = true; -#endif // !defined(_LIBCPP_HAS_NO_RANGES) +#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) // as_bytes & as_writable_bytes template <class _Tp, size_t _Extent> @@ -564,7 +564,7 @@ auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept -> enable_if_t<!is_const_v<_Tp>, decltype(__s.__as_writable_bytes())> { return __s.__as_writable_bytes(); } -#if !defined(_LIBCPP_HAS_NO_RANGES) +#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>>>; @@ -579,7 +579,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_RANGES) +#if !defined(_LIBCPP_HAS_NO_CONCEPTS) template<ranges::contiguous_range _Range> span(_Range&&) -> span<remove_reference_t<ranges::range_reference_t<_Range>>>; #endif |
