STL accumulate()