In my Fedora 34 environment (g++), std::accumulate is defined as:
template<typename ITER, typename T>
constexpr inline T accumulate(ITER first, ITER last, T init)
{
for (; first != last; ++first)
init = std::move(init) + *first; // why move ?
return init;
}
If the expression init + *first is already an rvalue, what is the purpose of std::move ?