[#BloombergLP-bslstl-BoyerMooreHorspoolSearcher-2constructor-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/BoyerMooreHorspoolSearcher.adoc[BoyerMooreHorspoolSearcher]::BoyerMooreHorspoolSearcher
:relfileprefix: ../../../
:mrdocs:

Create a `BoyerMooreHorspoolSearcher` object that can search for the sequence of `value&lowbar;type` values found in the specified range `&lsqb;needleFirst, needleLast)&rsqb;`&period; Generate meta&hyphen;data and save for use by `operator()`&period; The complexity of this process is O(M) where M is the length of the &quot;needle&quot;&period; Optionally specify a `hash` functor mapping mis&hyphen;matched values to the size of the next step in the search &hyphen;&hyphen; as large as, `needleLast &hyphen; needleFirst`&period; Optionally specify an `equal` functor for use with `hash` and for use by `operator()`&period; See &lcub;Requirements for `HASH` and `EQUAL`&rcub;&period; Optionally specify `basicAllocator` to supply memory&period; If `basicAllocator` is 0 or not supplied, the currently installed default allocator is used&period; The behavior is undefined unless `needleFirst` can be advanced to `needleLast`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
BoyerMooreHorspoolSearcher(
    RNDACC&lowbar;ITR&lowbar;NEEDLE needleFirst,
    RNDACC&lowbar;ITR&lowbar;NEEDLE needleLast,
    HASH hash = HASH(),
    EQUAL equal = EQUAL(),
    xref:BloombergLP/bslma/Allocator.adoc[BloombergLP::bslma::Allocator]* basicAllocator = 0);
----


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