[func.search.general]

# 22 General utilities library [[utilities]](./#utilities)

## 22.10 Function objects [[function.objects]](function.objects#func.search.general)

### 22.10.18 Searchers [[func.search]](func.search#general)

#### 22.10.18.1 General [func.search.general]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L15269)

Subclause [[func.search]](func.search "22.10.18 Searchers") provides function object types ([[function.objects]](function.objects "22.10 Function objects")) for
operations that search for a sequence [pat_first, pat_last) in another
sequence [first, last) that is provided to the object's function call
operator[.](#1.sentence-1)

The first sequence (the pattern to be searched for) is provided to
the object's constructor, and the second (the sequence to be searched) is
provided to the function call operator[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L15277)

Each specialization of a class template specified in [[func.search]](func.search "22.10.18 Searchers") shall meet the [*Cpp17CopyConstructible*](utility.arg.requirements#:Cpp17CopyConstructible "16.4.4.2 Template argument requirements [utility.arg.requirements]") and [*Cpp17CopyAssignable*](utility.arg.requirements#:Cpp17CopyAssignable "16.4.4.2 Template argument requirements [utility.arg.requirements]") requirements[.](#2.sentence-1)

Template parameters named

- [(2.1)](#2.1)

ForwardIterator,

- [(2.2)](#2.2)

ForwardIterator1,

- [(2.3)](#2.3)

ForwardIterator2,

- [(2.4)](#2.4)

RandomAccessIterator,

- [(2.5)](#2.5)

RandomAccessIterator1,

- [(2.6)](#2.6)

RandomAccessIterator2, and

- [(2.7)](#2.7)

BinaryPredicate

of templates specified in[[func.search]](func.search "22.10.18 Searchers") shall meet the same requirements and semantics as
specified in [[algorithms.general]](algorithms.general "26.1 General")[.](#2.sentence-2)

Template parameters named Hash shall meet the [*Cpp17Hash*](hash.requirements#:Cpp17Hash "16.4.4.5 Cpp17Hash requirements [hash.requirements]") requirements (Table [37](hash.requirements#tab:cpp17.hash "Table 37: Cpp17Hash requirements"))[.](#2.sentence-3)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L15296)

The Boyer-Moore searcher implements the Boyer-Moore search algorithm[.](#3.sentence-1)

The Boyer-Moore-Horspool searcher implements the Boyer-Moore-Horspool search algorithm[.](#3.sentence-2)

In general, the Boyer-Moore searcher will use more memory and give better runtime performance than Boyer-Moore-Horspool[.](#3.sentence-3)
