Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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