|
? function template
std::find_if
template
InputIterator find_if (InputIterator first, InputIterator last, UnaryPredicate pred);
Find element in range Returns an iterator to the first element in the range
[first,last) for which
pred returns
true. If no such element is found, the function returns
last.
返回范围内第一个符合要求的元素的迭代器,如果没有,则返回last.
#include
#include
#include
#include
using namespace std; void findif() { vector
v1{1,2,3,4,5,6,3,4,9,8}; array
ai{77,88}; cout<
运行截图:
The behavior of this function template is equivalent to:
|