c++ - GCC 中更详细的 C++17 状态?

标签 c++ gcc

考虑以下最小完整:

#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 中实现。您可以在这里测试各种编译器:

https://gcc.godbolt.org

关于c++ - GCC 中更详细的 C++17 状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47502773/

相关文章:

c++ - 使用 gcc 版本 4.1.2 模拟 is_pointer

c++ - 引用双指针,值是多少?

c++ - TMP 缓慢的常见罪魁祸首是什么

python - 即使在编辑 PATH、在 distutils 中创建文件、删除所有 -mno-cygwin 实例后,也无法让 Cython 找到 MinGW gcc 编译器

python - 无法安装mahotas,并且安装python-dev无法修复错误

c - 将 GCC 移植到 Multiclet

c++ - Qt 中的字符串对列表

c++ - Keil:虚拟或 protected 析构函数和堆

c++ - 如何在 Windows 和 Linux 上使用 C、C++ 从 tcp/ip 端口发送数据和获取数据

c++ - 如何序列化 Armadillo 的 vector