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

The first template function repeatedly replaces val with val + *I, for each value of the
InIt iterator I in the interval [first, last). It then returns val.
The second template function repeatedly replaces val with func(val, *I), for each value
of the InIt iterator I in the interval [first, last). It then returns val.
adjacent_difference
template<class InIt, class OutIt>
OutIt adjacent_difference(InIt first, InIt last,
OutIt result);
template<class InIt, class OutIt, class Fn2>
OutIt adjacent_difference(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 stored is *I - val, and val is replaced by *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 stored is func(*I, val), and val is replaced by *I. The
function returns result incremented last - first times.
inner_product
template<class InIt1, class InIt2, class Ty>
Ty inner_product(InIt1 first1, InIt1 last1,
Init2 first2, Ty val);
template<class InIt1, class InIt2, class Ty,
class Fn21, class Fn22>
Ty inner_product(InIt1 first1, InIt1 last1,
Init2 first2, Ty val, Fn21 func1, Fn22 func2);
The first template function repeatedly replaces val with val + (*I1 * *I2), for each
value of the InIt1 iterator I1 in the interval [first1, last2). In each case, the InIt2
iterator I2 equals first2 + (I1 - first1). The function returns val.
The second template function repeatedly replaces val with func1(val, func2(*I1,
*I2)), for each value of the InIt1 iterator I1 in the interval [first1, last2). In each
case, the InIt2 iterator I2 equals first2 + (I1 - first1). The function returns val.