template<class InputIterator, class OutputIterator>
OutputIterator inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
ForwardIterator2 inclusive_scan(ExecutionPolicy&& exec,
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result);
Effects: Эквивалентен:
return inclusive_scan(std::forward<ExecutionPolicy>(exec), first, last, result, plus<>());
template<class InputIterator, class OutputIterator, class BinaryOperation>
OutputIterator inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result,
BinaryOperation binary_op);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
class BinaryOperation>
ForwardIterator2 inclusive_scan(ExecutionPolicy&& exec,
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result,
BinaryOperation binary_op);
template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
OutputIterator inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result,
BinaryOperation binary_op, T init);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2, class BinaryOperation, class T>
ForwardIterator2 inclusive_scan(ExecutionPolicy&& exec,
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result,
BinaryOperation binary_op, T init);
Requires:
Если init предусмотрено, T должно быть MoveConstructible (Таблица 23); в противном случае ForwardIterator1тип значения должен быть MoveConstructible.
Если init предусмотрено, все binary_op(init, init), binary_op(init, *first)и binary_op(*first, *first) должны быть конвертированы в T; в противном случае binary_op(*first, *first) должен быть преобразован в ForwardIterator1тип значения.
binary_op не должен ни аннулировать итераторы или поддиапазоны, ни изменять элементы в диапазонах [first, last] или [result, result + (last - first)].
Effects: Каждому целому числу K в [0, last - first) присваивается result + K значение
GENERALIZED_NONCOMMUTATIVE_SUM(
binary_op,
init, *(first + 0), *(first + 1), ..., *(first + K))
если init предоставляется, или
GENERALIZED_NONCOMMUTATIVE_SUM(
binary_op,
*(first + 0), *(first + 1), ..., *(first + K))
иначе.