我试图尝试使用 C++17 标准中提出的新并行库功能,但我无法让它工作.我尝试使用 g++ 8.1.1
和 clang++-6.0
和 -std=c++17
的最新版本进行编译,但似乎都不支持 #include
、std::execution::par
或任何类似的东西.
I was trying to play around with the new parallel library features proposed in the C++17 standard, but I couldn't get it to work. I tried compiling with the up-to-date versions of g++ 8.1.1
and clang++-6.0
and -std=c++17
, but neither seemed to support #include <execution>
, std::execution::par
or anything similar.
在查看并行算法的 cppreference 时,有一长串算法,声称
When looking at the cppreference for parallel algorithms there is a long list of algorithms, claiming
技术规范提供了来自algorithm
、numeric
和memory
的以下69种算法的并行版本:( ... long list...)
Technical specification provides parallelized versions of the following 69 algorithms from
algorithm
,numeric
andmemory
: ( ... long list ...)
听起来算法已经纸上",但还没有准备好使用?
which sounds like the algorithms are ready 'on paper', but not ready to use yet?
在这个SO问题中一年前,答案声称这些功能尚未实现.但到现在为止,我本来希望看到某种实现.有什么我们可以使用的吗?
In this SO question from over a year ago the answers claim these features hadn't been implemented yet. But by now I would have expected to see some kind of implementation. Is there anything we can use already?
可以参考https://en.cppreference.com/w/cpp/compiler_support 检查所有 C++
功能实现状态.对于您的情况,只需搜索Standardization of Parallelism TS
",您会发现现在只有 MSVC
和 Intel C++
编译器支持此功能.
You can refer https://en.cppreference.com/w/cpp/compiler_support to check all C++
feature implementation status. For your case, just search "Standardization of Parallelism TS
", and you will find only MSVC
and Intel C++
compilers support this feature now.
这篇关于C++17 并行算法是否已经实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!