3 ms·
Of course, C++ already has std::accumulate, which is basically the same thing as a general fold or a summation, depending on which version you use. So, there is
by Figs 16y ago
Of course, C++ already has std::accumulate, which is basically the same thing as a general fold or a summation, depending on which version you use. So, there isn't really much of a reason to write sum manually at all. :p
http://www.sgi.com/tech/stl/accumulate.html http://www.sgi.com/tech/stl/accumulate.html