diff options
Diffstat (limited to 'libcxx/include/__algorithm/ranges_fill.h')
| -rw-r--r-- | libcxx/include/__algorithm/ranges_fill.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libcxx/include/__algorithm/ranges_fill.h b/libcxx/include/__algorithm/ranges_fill.h index 6ebc2bd67d6b..88a892f5c278 100644 --- a/libcxx/include/__algorithm/ranges_fill.h +++ b/libcxx/include/__algorithm/ranges_fill.h @@ -20,7 +20,7 @@ # pragma GCC system_header #endif -#if _LIBCPP_STD_VER > 17 +#if _LIBCPP_STD_VER >= 20 _LIBCPP_BEGIN_NAMESPACE_STD @@ -28,9 +28,8 @@ namespace ranges { namespace __fill { struct __fn { template <class _Type, output_iterator<const _Type&> _Iter, sentinel_for<_Iter> _Sent> - _LIBCPP_HIDE_FROM_ABI constexpr - _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const { - if constexpr(random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>) { + _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const { + if constexpr (random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>) { return ranges::fill_n(__first, __last - __first, __value); } else { for (; __first != __last; ++__first) @@ -40,20 +39,19 @@ struct __fn { } template <class _Type, output_range<const _Type&> _Range> - _LIBCPP_HIDE_FROM_ABI constexpr - borrowed_iterator_t<_Range> operator()(_Range&& __range, const _Type& __value) const { + _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __range, const _Type& __value) const { return (*this)(ranges::begin(__range), ranges::end(__range), __value); } }; } // namespace __fill inline namespace __cpo { - inline constexpr auto fill = __fill::__fn{}; +inline constexpr auto fill = __fill::__fn{}; } // namespace __cpo } // namespace ranges _LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP_STD_VER > 17 +#endif // _LIBCPP_STD_VER >= 20 #endif // _LIBCPP___ALGORITHM_RANGES_FILL_H |
