```
template <class InputIterator, class OutputIterator>
OutputIterator partial_sum(
InputIterator first, InputIterator last,
OutputIterator result);
template <class InputIterator, class OutputIterator, class BinaryOperation>
OutputIterator partial_sum(
InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation binary_op);
```

The result of the expression acc + *i or binary_op(acc, *i) shall be
implicitly convertible to InputIterator's value type.

Effects: For a non-empty range,
the function creates an accumulator acc whose type is InputIterator's
value type, initializes it with *first,
and assigns the result to *result.

For every iterator i in [first + 1, last)
in order, acc is then modified by acc = acc + *i or acc = binary_op(acc, *i)
and the result is assigned to *(result + (i - first)).