Namespaces
Variants
Views
Actions

Talk:cpp/algorithm/accumulate

From cppreference.com

[edit] Suggestion

This is the same as a high level fold. It might be good to mention this.

Zzing 23:57, 16 January 2012 (PST)

134.130.190.58 04:35, 29 February 2016 (PST)gb I never remember if the accumulated parameter is passed as the first or second argument to the binary operator and this page doesnt really help much clarifying it.

It might be worth it to rename `a` and `b` in the signature of the binaryoperator to `acc` and `i`, and explain that `acc` is the last acummulated value (initialized to the initial value) and `i` the value of the current element.