我在命令行开发工具中使用 Mac OS Catalina 和捆绑的 c++ 编译器。在执行以下代码时
#include <iostream>
#include <vector>
#include <algorithm>
#include <execution>
int main()
{
std::vector<int> Vec
{ 4, 3, 5, 2, 6, 1 };
sort(std::execution::par, begin(Vec), end(Vec));
for (const auto &x: Vec)
{
std:: cout << x << " ";
}
return 0;
}
我收到错误消息:
g++ --std=c++17 sort.cpp sort.cpp:25:10: fatal error: 'execution' file not found 1 error generated.
我正在使用 c++ 17 版本。后来我也安装了 brew gcc 版本 9 和同样的故事。我不能使用并行执行。