我试图让这个片段编译
#include <vector>
#include <numeric>
#include <execution>
double result = std::reduce(std::execution::par, v.begin(), v.end());
Run Code Online (Sandbox Code Playgroud)
我试过这些编译器:
Apple LLVM version 8.1.0 (clang-802.0.42)
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Run Code Online (Sandbox Code Playgroud)
这三个人都给了我 'execution' file not found
分别 error: no member named 'reduce' in namespace 'std'
auto result = std::reduce(v.begin(), v.end());
对于这个片段
#include<numeric>
#include<vector>
int main(int argc, char *argv[])
{
std::vector<double> v(10, 1);
auto result = std::reduce(v.begin(), v.end());
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我想我的编译器太旧了?但是在cppreference上它没有说明哪个编译器版本最低,而且我没有在repo中看到任何更新版本的clang或gcc.