?
function templatestd::find_if
templateFind element in range Returns an iterator to the first element in the rangeInputIterator find_if (InputIterator first, InputIterator last, UnaryPredicate pred);
[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}; arrayai{77,88}; cout< 运行截图: The behavior of this function template is equivalent to:
?
The behavior of this function template is equivalent to: