[#BloombergLP-bslstl-DefaultSearcher-operator_call] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/DefaultSearcher.adoc[DefaultSearcher]::operator() :relfileprefix: ../../../ :mrdocs: Search `[haystackFirst, haystackLast)]` for the constructed pattern. == Synopsis Declared in `<bslstl_defaultsearcher.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class FORWARD_ITR_HAYSTACK> xref:bsl/pair-0b.adoc[bsl::pair<FORWARD_ITR_HAYSTACK, FORWARD_ITR_HAYSTACK>] operator()( FORWARD_ITR_HAYSTACK haystackFirst, FORWARD_ITR_HAYSTACK haystackLast) const; ---- == Description Return the range where those values are found, or the range `[haystackLast, haystackLast)]` if that sequence is not found. The search is performed using a "naive" algorithm that has time complexity of: ` bsl::distance(needleFirst(), needleLast()) * bsl::distance(haystackFirst, haystackLast); ` 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 equal `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. == Return Value range where the needle is found, or `[haystackLast, haystackLast)]` 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]#