[#BloombergLP-bslstl-BoyerMooreHorspoolSearcher-operator_call]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/BoyerMooreHorspoolSearcher.adoc[BoyerMooreHorspoolSearcher]::operator()
:relfileprefix: ../../../
:mrdocs:

Search the specified range `&lsqb;haystackFirst, haystackLast)&rsqb;` for the first sequence of `value&lowbar;type` values specified on construction&period; Return the range where those values are found, or the range `&lsqb;haystackLast, haystackLast)&rsqb;` if that sequence is not found&period; The search is performed using an implementation of the Boyer Moore Horspool algorithm and has a complexity of O(N) for random text&period; Values of the &quot;needle&quot; sequence and the &quot;haystack&quot; sequence are compared using the equality comparison functor specified on construction&period; 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&period; Note that if the &quot;needle&quot; sequence is empty, the range `&lsqb;haystackFirst, haystackFirst)&rsqb;` is returned&period; Also note that if the &quot;needle&quot; sequence is longer than the &quot;haystack&quot; sequence &hyphen;&hyphen; thus, impossible for the &quot;needle&quot; to be found in the &quot;haystack&quot; &hyphen;&hyphen; the range `&lsqb;haystackLast, haystackLast)&rsqb;` is returned&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;boyermoorehorspoolsearcher&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RNDACC&lowbar;ITR&lowbar;HAYSTACK&gt;
xref:bsl/pair-0b.adoc[bsl::pair&lt;RNDACC&lowbar;ITR&lowbar;HAYSTACK, RNDACC&lowbar;ITR&lowbar;HAYSTACK&gt;]
operator()(
    RNDACC&lowbar;ITR&lowbar;HAYSTACK haystackFirst,
    RNDACC&lowbar;ITR&lowbar;HAYSTACK haystackLast) const;
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
