C++0x 和 C++11的区别

The old -std=c++0x is only needed for older compiler versions that did not support -std=c++11 and they chose that name to express the preliminary and unstable nature of features (and the ABI) of the then upcoming C++11 (and when it was still unclear whether that would eventually become C++10 or C++12). They changes some of the details adapting to the changing working drafts of the standard at the time before the C++11 standard was officially released.If your compiler supports -std=c++11, there is no reason to use -std=c++0x. Concerning compatibility: There might even be differences and incompatibilities, but these are not just bound to the use of -std=c++0x, but to specific versions of the compiler. When the compiler supports both, they should be identical.

旧的-std=c++0x 只针对那些不支持 -std=c++11的旧编译器版本,他们选择这个名称来表示随后的( 当它还不清楚是否最终会变成 C++10 或者 C++12 时)的特性的初步和不稳定特性。 在C++11标准正式发布之前,他们更改了适应标准变更工作草稿的一些细节。

如果编译器支持 -std=c++11,则没有理由使用 -std=c++0x 。 有关兼容性:甚至可以能存在差异和不兼容性,但这些不仅限于 -std=c++0x的使用,而是编译器的特定版本。 当编译器同时支持两者时,它们应该是相同的。

参考

https://stackoverflow.com/questions/9538701/what-is-the-difference-between-c0x-and-c11

https://www.zhihu.com/question/20141092

https://www.douban.com/note/577010219/

https://www.tutorialspoint.com/What-is-the-difference-between-Cplusplus0x-and-Cplusplus11

发布了289 篇原创文章 · 获赞 13 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/LU_ZHAO/article/details/105194424