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

Search `&lsqb;haystackFirst, haystackLast)&rsqb;` for the constructed pattern&period;

== Synopsis

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

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

== Description

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 a &quot;naive&quot; algorithm that has time complexity of&colon; &grave; bsl&colon;&colon;distance(needleFirst(), needleLast()) &ast; bsl&colon;&colon;distance(haystackFirst, haystackLast)&semi; &grave; 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 equal `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;

== Return Value

range where the needle is found, or `&lsqb;haystackLast, haystackLast)&rsqb;` if not found

== Parameters

[cols="1,4"]
|===
| Name| Description
| *haystackFirst*
| beginning of the haystack sequence to search
| *haystackLast*
| end of the haystack sequence to search
|===


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