diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -158,7 +158,6 @@ inline constexpr size_t dynamic_extent = numeric_limits::max(); template class span; - template struct __is_std_array : false_type {}; @@ -171,7 +170,7 @@ template struct __is_std_span> : true_type {}; -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) template concept __span_compatible_range = ranges::contiguous_range<_Range> && @@ -181,7 +180,7 @@ !__is_std_array>::value && !is_array_v> && is_convertible_v>(*)[], _ElementType(*)[]>; -#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) template class _LIBCPP_TEMPLATE_VIS span { @@ -211,7 +210,6 @@ constexpr span (const span&) noexcept = default; constexpr span& operator=(const span&) noexcept = default; -#if _LIBCPP_STD_VER > 17 template && is_convertible_v>(*)[], element_type (*)[]>, @@ -235,7 +233,6 @@ _LIBCPP_ASSERT(__last - __first == _Extent, "invalid range in span's constructor (iterator, sentinel): last - first != extent"); } -#endif // _LIBCPP_STD_VER > 17 _LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t (&__arr)[_Extent]) noexcept : __data{__arr} {} @@ -249,13 +246,13 @@ _LIBCPP_INLINE_VISIBILITY constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {} -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) template <__span_compatible_range _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 // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +#endif template _LIBCPP_INLINE_VISIBILITY @@ -402,7 +399,6 @@ constexpr span (const span&) noexcept = default; constexpr span& operator=(const span&) noexcept = default; -#if _LIBCPP_STD_VER > 17 template && is_convertible_v > (*)[], element_type (*)[]>, @@ -419,7 +415,6 @@ _LIBCPP_INLINE_VISIBILITY constexpr span(_It __first, _End __last) : __data(_VSTD::to_address(__first)), __size(__last - __first) {} -#endif // _LIBCPP_STD_VER > 17 template _LIBCPP_INLINE_VISIBILITY @@ -435,11 +430,11 @@ _LIBCPP_INLINE_VISIBILITY constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {} -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) template <__span_compatible_range _Range> _LIBCPP_INLINE_VISIBILITY constexpr span(_Range&& __r) : __data(ranges::data(__r)), __size{ranges::size(__r)} {} -#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +#endif template _LIBCPP_INLINE_VISIBILITY @@ -544,13 +539,11 @@ size_type __size; }; -#if _LIBCPP_STD_VER > 17 template inline constexpr bool ranges::enable_borrowed_range > = true; template inline constexpr bool ranges::enable_view> = true; -#endif // _LIBCPP_STD_VER > 17 // as_bytes & as_writable_bytes template @@ -579,7 +572,7 @@ template span(const array<_Tp, _Sz>&) -> span; -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) +#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) template span(_Range&&) -> span>>; #endif