Skip to content

Instantly share code, notes, and snippets.

@mochow13
Last active September 15, 2018 04:32
Show Gist options
  • Save mochow13/9231f57f7cee48fce6357f2f07f70c7d to your computer and use it in GitHub Desktop.
Save mochow13/9231f57f7cee48fce6357f2f07f70c7d to your computer and use it in GitHub Desktop.
std::vector<int> collection={1,2,0,5,0,3,4};
// itr contains the iterator to the first element following the specific property
auto itr = std::find_if(begin(collection), end(collection), [](int x) {
return x%2==0; // the property
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment