gcc中c ++ 11支持的官方状态

时间:2021-07-13 02:24:03

This is not a question about which c++11 features are supported by gcc (I believe since 4.8 the c++11 support is pretty complete), but if there are any known problems in using them in production code.

这不是一个关于gcc支持哪些c ++ 11特性的问题(我相信自4.8以来c ++ 11支持非常完整),但是如果在生产代码中使用它们有任何已知问题。

The reason I'm asking is that I had a look at the manual for gcc5.2 and in the section "Language Standards Supported by GCC" it reads:

我问的原因是我查看了gcc5.2的手册,并在“GCC支持的语言标准”一节中读到:

[...] most of which have been implemented in an experimental C++11 mode in GCC.

[...]其中大部分已在GCC的实验C ++ 11模式中实现。

That word experimental got me a little worried, but on the other hand, c++14 isn't even mentioned, although I believe GCC supports all of those features, too. So is this just an oversight in the documentation or are there really any valid concerns against using c++11 features in production code that will be compiled with gcc5.2 (4.8)?

实验这个词让我有点担心,但另一方面,甚至没有提到c ++ 14,尽管我相信GCC也支持所有这些功能。那么这只是对文档的疏忽,还是在使用gcc5.2(4.8)编译的生产代码中使用c ++ 11特性时是否存在任何有效的问题?

1 个解决方案

#1


8  

Looks like actually it's experimental only on words. In gcc 6.0 it will not be experimental more.

看起来实际上它只是在单词上进行实验。在gcc 6.0中,它不会更具实验性。

The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98.

C ++的默认模式现在是-std = gnu ++ 14而不是-std = gnu ++ 98。

But now, default mode is gnu++98 and so, it's experimental (one of the reasons, why we don't use C++11/C++14 now).

但是现在,默认模式是gnu ++ 98,所以它是实验性的(原因之一,为什么我们现在不使用C ++ 11 / C ++ 14)。

#1


8  

Looks like actually it's experimental only on words. In gcc 6.0 it will not be experimental more.

看起来实际上它只是在单词上进行实验。在gcc 6.0中,它不会更具实验性。

The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98.

C ++的默认模式现在是-std = gnu ++ 14而不是-std = gnu ++ 98。

But now, default mode is gnu++98 and so, it's experimental (one of the reasons, why we don't use C++11/C++14 now).

但是现在,默认模式是gnu ++ 98,所以它是实验性的(原因之一,为什么我们现在不使用C ++ 11 / C ++ 14)。