[libcxx-commits] [PATCH] D119198: [libc++] Remove default_searcher from experimental/functional

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 8 10:50:29 PST 2022


jloser added inline comments.


================
Comment at: libcxx/include/experimental/functional:106
 
-#if _LIBCPP_STD_VER > 11
-// default searcher
-template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
-class _LIBCPP_TEMPLATE_VIS default_searcher {
-public:
-    _LIBCPP_INLINE_VISIBILITY
-    default_searcher(_ForwardIterator __f, _ForwardIterator __l,
-                       _BinaryPredicate __p = _BinaryPredicate())
-        : __first_(__f), __last_(__l), __pred_(__p) {}
-
-    template <typename _ForwardIterator2>
-    _LIBCPP_INLINE_VISIBILITY
-    pair<_ForwardIterator2, _ForwardIterator2>
-    operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
-    {
-        return _VSTD::__search(__f, __l, __first_, __last_, __pred_,
-            typename iterator_traits<_ForwardIterator>::iterator_category(),
-            typename iterator_traits<_ForwardIterator2>::iterator_category());
-    }
-
-private:
-    _ForwardIterator __first_;
-    _ForwardIterator __last_;
-    _BinaryPredicate __pred_;
-    };
-
+#if _LIBCPP_STD_VER > 14
 template<class _ForwardIterator, class _BinaryPredicate = equal_to<>>
----------------
ldionne wrote:
> Please don't bump the standard version in this patch, since it's technically an unrelated change (IIUC).
It's required if we want `make_default_searcher` to work at all since `std::default_searcher` is C++17-or-later only (https://github.com/llvm/llvm-project/blob/main/libcxx/include/__functional/default_searcher.h#L25). Otherwise, we can't remove `std::experimental::default_searcher` if we want these to work in C++14-or-later and not C++17-or-later.

We could remove `make_default_searcher` entirely, but I think that'd be for a separate patch and I don't see the reason to do so right now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119198/new/

https://reviews.llvm.org/D119198



More information about the libcxx-commits mailing list