Jump to content

C++ Language/Std/Stl/Algorithms/Querying/Accumulating

From Wikibooks, open books for an open world

The std::accumulate() algorithm iterates over items, accumulating them into a summation (or into some other kind of combination, if you provide a custom callable-object for doing each accumulation step).

Additional information about the std::accumulate() algorithm (includes interactive examples)