Standard C++ Library Reference ISO/IEC (VERSION3)

partial_sum
template<class InIt, class OutIt>
OutIt partial_sum(InIt first, InIt last,
OutIt result);
template<class InIt, class OutIt, class Fn2>
OutIt partial_sum(InIt first, InIt last,
OutIt result, Fn2 func);
The first template function stores successive values beginning at result, for each value of the
InIt iterator I in the interval [first, last). The first value val stored (if any) is *I.
Each subsequent value val stored is val + *I. The function returns result incremented
last - first times.
The second template function stores successive values beginning at result, for each value of
the InIt iterator I in the interval [first, last). The first value val stored (if any) is
*I. Each subsequent value val stored is func(val, *I). The function returns result
incremented last - first times.
See also the Table of Contents and the Index.
Copyright © 1994-2001 by P.J. Plauger. Portions derived from work copyright © 1994 by
Hewlett-Packard Company. All rights reserved.