Searcher functor using a naive sequential search for a fixed needle.

Synopsis

Declared in <bslstl_defaultsearcher.h>

template<
    class FORWARD_ITR_NEEDLE,
    class EQUAL = bsl::equal_to<bsl::iterator_traits<FORWARD_ITR_NEEDLE>::value_type>>
class DefaultSearcher;

Description

This class template defines functors that can search for the sequence of value_type values defined on construction (i.e., the "needle") in sequences of value_type values (i.e., "haystacks") passed to the functor's operator().

Member Functions

Name

Description

DefaultSearcher [constructor]

Create a searcher for the needle [needleFirst, needleLast)].

equal

Return the functor used by this searcher object to compare value_type values.

needleFirst

Return an iterator referring to the first element of the sequence of value_type values that can be sought by this searcher object.

needleLast

Return an iterator referring to one past the last element of the sequence of value_type values that can be sought by this searcher object.

operator()

Search [haystackFirst, haystackLast)] for the constructed pattern.

Created with MrDocs