std::search
From cppreference.com
| Defined in header <algorithm>
|
||
template< class ForwardIt1, class ForwardIt2 > ForwardIt1 search( ForwardIt1 first, ForwardIt1 last, |
(1) | (constexpr since C++20) |
| template< class ExecutionPolicy, class ForwardIt1, class ForwardIt2 > ForwardIt1 search( ExecutionPolicy&& policy, |
(2) | (since C++17) |
template< class ForwardIt1, class ForwardIt2, class BinaryPred > ForwardIt1 search( ForwardIt1 first, ForwardIt1 last, |
(3) | (constexpr since C++20) |
| template< class ExecutionPolicy, class ForwardIt1, class ForwardIt2, class BinaryPred > |
(4) | (since C++17) |
| template< class ForwardIt, class Searcher > ForwardIt search( ForwardIt first, ForwardIt last, |
(5) | (since C++17) (constexpr since C++20) |
1-4) Searches for the first occurrence of the sequence of elements
[s_first, s_last) in the range [first, last).1) Elements are compared using operator==.
3) Elements are compared using the given binary predicate p.
2,4) Same as (1,3), but executed according to policy.
These overloads participate in overload resolution only if all following conditions are satisfied:
|
std::is_execution_policy_v<std::decay_t<ExecutionPolicy>> is true. |
(until C++20) |
|
std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> is true. |
(since C++20) |
5) Searches the range
[first, last) for the pattern specified in the constructor of searcher.|
The standard library provides the following searchers:
|
(since C++17) |
Contents |