GCC中更详细的C 17状态

More detailed C++17 status in GCC?

本文关键字:状态 GCC      更新时间:2023-10-16

考虑以下最小完成:

#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上找到相关的东西像检查 #if __has_include(<execution>)一样琐碎地自动化,但是 <numeric>是旧的,我看不到任何干净的方法来检查它是否包含特定的定义)。除了脚本解析STL标题外,是否还有有关当前草案中描述的某些内容是否已经实施的快速信息?什么时候会有什么?

在另一个页面上记录了库(libstdc )支持:

https://gcc.gnu.org/onlinedocs/libstdc /manual/status.html#status.iso.iso.201z

"平行性TS"仍然标记为"否",因此尚未实施。它也没有在Clang中实施。您可以在此处测试各种编译器:

https://gcc.godbolt.org