#include <iostream>
#include <vector>
#include <algorithm>
using std::cout;
using std::endl;
int main()
{
std::vector<int> vec = { 3, 1, 4, 2, 5, 8, 6, 9 };
std::vector<int>::iterator pos;
pos = std::find_if(vec.begin(), vec.end(), [](int element) { return element % 2 == 0; });
cout << *pos << endl;
return 0;
}
/*
run:
4
*/