std::accumulate vs. std::reduce--Simon Brand
Old vs new.
std::accumulate vs. std::reduce
by Simon Brand
From the article:
std::accumulate has been a part of the standard library since C++98. It provides a way to fold a binary operation (such as addition) over an iterator range, resulting in a single value. std::reduce was added in C++17 and looks remarkably similar. This post will explain the difference between the two and when to use one or the other...