为什么C++标准中没有并行的`std::accumulate`?

问题描述 投票:0回答:1

我认为 C++ 标准中没有

std::accumulate
的并行版本是令人困惑的。在我看来,并行实现它是微不足道的,例如基于 OpenMP 或 SIMD 指令。有人能很好地解释为什么标准委员会选择引入
std::reduce
的并行版本而不是
std::accumulate
吗?是因为迭代器类型不同吗?

https://en.cppreference.com/w/cpp/algorithm/accumulate

c++ c++17 c++-standard-library
1个回答
0
投票

因为它叫做 std::reduce

© www.soinside.com 2019 - 2024. All rights reserved.