std::find_first_of
Template:cpp/algorithm/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td><algorithm>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >ForwardIterator1 find_first_of( ForwardIterator1 first, ForwardIterator1 last,
<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">
<td >ForwardIterator1 find_first_of( ForwardIterator1 first, ForwardIterator1 last,
<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end
Searches the range [first, last)
for any of the elements in the range [s_first, s_last)
. The first version uses operator==
to compare the elements, the second version uses the given binary predicate p
.
Contents |
Parameters
first, last | - | the range of elements to examine |
s_first, s_last | - | the range of elements to search for |
p | - | binary predicate which returns true if the elements should be treated as equal. The signature of the predicate function should be equivalent to the following: bool pred(const Type1 &a, const Type2 &b); While the signature does not need to have const &, the function must not modify the objects passed to it and must be able to accept all values of type (possibly const) |
Return value
iterator to the first element in the range [first, last)
that is equal to an element from the range [s_first; s_last)
. If no such element is found, last
is returned.
Complexity
does at most (S*N)
comparisons where Template:cpp and Template:cpp.