c++ 查找容器中不满足条件的元素,返回iterator(find_if_not)

时间:2023-03-09 16:46:04
c++ 查找容器中不满足条件的元素,返回iterator(find_if_not)
#include <iostream>     // std::cout
#include <algorithm> // std::find_if_not
#include <array> // std::array
using namespace std;
int main () {
array<int,> foo = {,,,,}; array<int,>::iterator it =find_if_not (foo.begin(), foo.end(), [](int i){return i%;} ); //偶数就为假
cout << "The first even value is " << *it << '\n'; return ;
}