diff libcxx/include/__algorithm/ranges_copy_if.h @ 252:1f2b6ac9f198 llvm-original

LLVM16-1
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 18 Aug 2023 09:04:13 +0900
parents c4bab56944e8
children
line wrap: on
line diff
--- a/libcxx/include/__algorithm/ranges_copy_if.h	Wed Nov 09 17:47:54 2022 +0900
+++ b/libcxx/include/__algorithm/ranges_copy_if.h	Fri Aug 18 09:04:13 2023 +0900
@@ -24,21 +24,19 @@
 #  pragma GCC system_header
 #endif
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER >= 20
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 namespace ranges {
 
-template<class _Ip, class _Op>
+template <class _Ip, class _Op>
 using copy_if_result = in_out_result<_Ip, _Op>;
 
 namespace __copy_if {
 struct __fn {
-
   template <class _InIter, class _Sent, class _OutIter, class _Proj, class _Pred>
-  _LIBCPP_HIDE_FROM_ABI static constexpr
-  copy_if_result <_InIter, _OutIter>
+  _LIBCPP_HIDE_FROM_ABI static constexpr copy_if_result<_InIter, _OutIter>
   __copy_if_impl(_InIter __first, _Sent __last, _OutIter __result, _Pred& __pred, _Proj& __proj) {
     for (; __first != __last; ++__first) {
       if (std::invoke(__pred, std::invoke(__proj, *__first))) {
@@ -49,20 +47,23 @@
     return {std::move(__first), std::move(__result)};
   }
 
-  template <input_iterator _Iter, sentinel_for<_Iter> _Sent, weakly_incrementable _OutIter, class _Proj = identity,
+  template <input_iterator _Iter,
+            sentinel_for<_Iter> _Sent,
+            weakly_incrementable _OutIter,
+            class _Proj = identity,
             indirect_unary_predicate<projected<_Iter, _Proj>> _Pred>
     requires indirectly_copyable<_Iter, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
-  copy_if_result<_Iter, _OutIter>
+  _LIBCPP_HIDE_FROM_ABI constexpr copy_if_result<_Iter, _OutIter>
   operator()(_Iter __first, _Sent __last, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
     return __copy_if_impl(std::move(__first), std::move(__last), std::move(__result), __pred, __proj);
   }
 
-  template <input_range _Range, weakly_incrementable _OutIter, class _Proj = identity,
+  template <input_range _Range,
+            weakly_incrementable _OutIter,
+            class _Proj = identity,
             indirect_unary_predicate<projected<iterator_t<_Range>, _Proj>> _Pred>
     requires indirectly_copyable<iterator_t<_Range>, _OutIter>
-  _LIBCPP_HIDE_FROM_ABI constexpr
-  copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
+  _LIBCPP_HIDE_FROM_ABI constexpr copy_if_result<borrowed_iterator_t<_Range>, _OutIter>
   operator()(_Range&& __r, _OutIter __result, _Pred __pred, _Proj __proj = {}) const {
     return __copy_if_impl(ranges::begin(__r), ranges::end(__r), std::move(__result), __pred, __proj);
   }
@@ -70,12 +71,12 @@
 } // namespace __copy_if
 
 inline namespace __cpo {
-  inline constexpr auto copy_if = __copy_if::__fn{};
+inline constexpr auto copy_if = __copy_if::__fn{};
 } // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
 
-#endif // _LIBCPP_STD_VER > 17
+#endif // _LIBCPP_STD_VER >= 20
 
 #endif // _LIBCPP___ALGORITHM_RANGES_COPY_IF_H