20 General utilities library [utilities]
template<class ForwardIterator1, class BinaryPredicate = equal_to<>>
class default_searcher {
public:
constexpr default_searcher(ForwardIterator1 pat_first, ForwardIterator1 pat_last,
BinaryPredicate pred = BinaryPredicate());
template<class ForwardIterator2>
constexpr pair<ForwardIterator2, ForwardIterator2>
operator()(ForwardIterator2 first, ForwardIterator2 last) const;
private:
ForwardIterator1 pat_first_;
ForwardIterator1 pat_last_;
BinaryPredicate pred_;
};
constexpr default_searcher(ForwardIterator pat_first, ForwardIterator pat_last,
BinaryPredicate pred = BinaryPredicate());
Effects: Constructs a
default_searcher object, initializing
pat_first_
with
pat_first,
pat_last_ with
pat_last, and
pred_ with
pred. Throws: Any exception thrown by the copy constructor of
BinaryPredicate or
ForwardIterator1. template<class ForwardIterator2>
constexpr pair<ForwardIterator2, ForwardIterator2>
operator()(ForwardIterator2 first, ForwardIterator2 last) const;
Effects: Returns a pair of iterators
i and
j such that
- i == search(first, last, pat_first_, pat_last_, pred_), and
- if i == last, then j == last,
otherwise j == next(i, distance(pat_first_, pat_last_)).