More Algorithms
This section introduces two more algorithms, the fused and scan algorithms!
We'll cover the following...
We'll cover the following...
transform_reduce - Fused Algorithm
To get even more flexibility and performance, the reduce algorithm also has a version where you can apply a transform operation before performing the reduction.
The above code will first execute the unary functor - the lambda that doubles the input value; then the results will be reduced into a single sum.
The fused version will be faster than using two algorithms: std::reduce ...