Why has std::accumulate not been made constexpr in C++20?
问题 In C++20, many (most?) C++-standard-library algorithms have been made constexpr . Yet - std::accumulate has not. It seems like it could have been: template<class InputIt, class T> constexpr T accumulate(InputIt first, InputIt last, T init) { for (; first != last; ++first) { init = std::move(init) + *first; } return init; } So - is there a reason it wasn't constexpr 'ed as well? Note: This question was motivated by my answer to this question on compile-time accumulation. 回答1: P1645R1 was