cpp/algorithm/partial sum

If is not empty, computes the partial sums of the elements in its subranges and writes the sums to the range beginning at.

Internally, a variable, whose type is the value type of , is used as accumulator for intermediate results.

@1@ Uses to sum up the elements. Equivalent to:

@2@ Uses the given binary function. Equivalent to:

@@ If invalidates any iterators (including the end iterators) or modifies any elements of the range involved, the behavior is undefined.

Return value
Iterator to the element past the last element written, or if  is empty.

Complexity
Given as : @1@ exactly applications of @2@ exactly  applications of the binary function