https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104251

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The non-parallel version of std::reduce really only exists for completeness,
because the parallel overload (the one taking an execution policy argument)
exists, and so a non-parallel one was added too.

For the parallel version there are significant optimizations possible if the
"sum" can be done in any order, so it's an important algorithm for the parallel
case. For the serial case, it doesn't really need to exist (std::accumulate is
already good enough). But as I said, it's there for completeness because
there's no reason it can't be done serially.

Reply via email to