Search the specified range [haystackFirst, haystackLast)] for the first sequence of value_type values specified on construction. Return the range where those values are found, or the range [haystackLast, haystackLast)] if that sequence is not found. The search is performed using an implementation of the Boyer Moore Horspool algorithm and has a complexity of O(N) for random text. Values of the "needle" sequence and the "haystack" sequence are compared using the equality comparison functor specified on construction. The behavior is undefined unless haystackFirst can be advanced to haystackLast and the iterators used to construct this object, needleFirst() and needleLast(), are still valid. Note that if the "needle" sequence is empty, the range [haystackFirst, haystackFirst)] is returned. Also note that if the "needle" sequence is longer than the "haystack" sequence ‐‐ thus, impossible for the "needle" to be found in the "haystack" ‐‐ the range [haystackLast, haystackLast)] is returned.

Synopsis

Declared in <bslstl_boyermoorehorspoolsearcher.h>

template<class RNDACC_ITR_HAYSTACK>
bsl::pair<RNDACC_ITR_HAYSTACK, RNDACC_ITR_HAYSTACK>
operator()(
    RNDACC_ITR_HAYSTACK haystackFirst,
    RNDACC_ITR_HAYSTACK haystackLast) const;

Created with MrDocs