Skip to content

Instantly share code, notes, and snippets.

@fabiogaluppo
Last active December 7, 2015 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiogaluppo/74e72907ac42b9c5fca1 to your computer and use it in GitHub Desktop.
Save fabiogaluppo/74e72907ac42b9c5fca1 to your computer and use it in GitHub Desktop.
initial = 0;
total = std::accumulate(std::begin(xs), std::begin(xs) + 6,
accumulator_with_predicate<int>(initial, is_even));
std::cout << total << "\n"; //12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment