We often need to reduce a numeric range. That is where std::reduce comes in handy.

We'll cover the following

The six new algorithms that are typically used for parallel execution are also known under the name prefix sum. If the given binary callables are not associative and commutative, the behavior of the algorithms is undefined.


This reduces the elements of the range. init is the start value.

Get hands-on with 1000+ tech skills courses.