考虑以下最小完整:
#include <numeric>
int main() {
std::transform_reduce();
}
尝试使用 GCC 7.2 编译它会导致错误:
[bipll@home ~]$ g++ -std=c++17 omg.cpp
omg.cpp: In function ‘int main()’:
omg.cpp:4:7: error: ‘transform_reduce’ is not a member of ‘std’
std::transform_reduce();
^~~~~~~~~~~~~~~~
[bipll@home ~]$ g++ -v |& tail -1
gcc version 7.2.0 (GCC)
我试图在 https://gcc.gnu.org/projects/cxx-status.html 上找到相关的东西但它主要涵盖了语言特性,我还没有看到任何关于新 STL 定义支持的内容(有时这可以很简单地自动化,比如检查 #if __has_include(<execution>)
,但是 <numeric>
是一个旧的包含,我没有看到任何干净的方法来检查它是否包含特定定义)。除了以脚本方式解析 STL header 之外,是否有任何关于当前草案中描述的内容是否已经实现的快速信息来源?什么时候可能会有其他事情?
最佳答案
库 (libstdc++) 支持记录在不同的页面上:
https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.201z
“Parallelism TS”仍标记为“No”,因此尚未实现。它也没有在 Clang 中实现。您可以在这里测试各种编译器:
关于c++ - GCC 中更详细的 C++17 状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47502773/