Numeric
The numeric algorithms std::accumulate
, std::adjacent_difference
, std::partial_sum
, std::inner_product
and std::iota
and the six additional C++17 algorithms std::exclusive_scan
, std::inclusive_scan
, std::transform_exclusive_scan
, std::transform_inclusive_scan
, std::reduce
, and std::transform_reduce
are special. All of them are defined in the header <numeric>
. They are widely applicable, because they can be configured with a callable.
Accumulates the elements of the range. init
is the start value:
Calculates the difference between adjacent elements of the range and stores the result in result
: