cpp/utility/functional/default searcher

A class suitable for use with overload of std that delegates the search operation to the pre-C++17 standard library's std.

is and.

Member functions
{{member|{{small|std::default_searcher::}}default_searcher|2= {{dcl begin}} {{dcl rev multi|since1=c++17|dcl1= default_searcher( ForwardIt pat_first,                 ForwardIt pat_last,                  BinaryPredicate pred = BinaryPredicate ); constexpr default_searcher( ForwardIt pat_first,                           ForwardIt pat_last,                            BinaryPredicate pred = BinaryPredicate ); }} {{dcl end}} Constructs a {{tt|std::default_searcher}} by storing copies of {{c|pat_first}}, {{c|pat_last}}, and {{c|pred}}.
 * since2=c++20|dcl2=

Exceptions
Any exceptions thrown by the copy constructors of or. }}

{{member|{{small|std::default_searcher::}}operator|2= {{dcl begin}} {{dcl rev multi|since1=c++17|dcl1= template< class ForwardIt2 > std::pair operator( ForwardIt2 first, ForwardIt2 last ) const; template< class ForwardIt2 > constexpr std::pair operator( ForwardIt2 first, ForwardIt2 last ) const; }} {{dcl end}} The member function called by the Searcher overload of {{lc|std::search}} to perform a search with this searcher.
 * since2=c++20|dcl2=

Returns a pair of iterators {{tt|i, j}}, where {{tt|i}} is {{c|std::search(first, last, pat_first, pat_last, pred)}} and {{tt|j}} is {{c|std::next(i, std::distance(pat_first, pat_last))}} unless {{tt|std::search}} returned {{c|last}} (no match), in which case {{tt|j}} equals {{c|last}} as well.

Return value
A pair of iterators to the first and one past last positions in where a subsequence that compares equal to  as defined by  is located, or a pair of copies of  otherwise. }}