-std = c ++ 0x和-std = c ++ 11之间有什么区别? [英] What is the difference between -std=c++0x and -std=c++11

查看:418
本文介绍了-std = c ++ 0x和-std = c ++ 11之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



但是我不知道有什么区别,哪个更适合。

>

似乎他们都正常使用C ++ 11。

解决方案

您应该更喜欢 -std = c ++ 11



(注意:我假设code> -std = c ++ 11x 是你的问题的打字错误)



旧的<$ c $只有不支持 -std = c ++ 11 的旧版本的编译器版本才需要c> -std = c ++ 0x 该名称表达即将到来的 C ++ 11 的特征(和ABI)的初步和不稳定的性质(当仍然不清楚是否最终将变为 C ++ 10 C ++ 12 )。在C ++ 11标准正式发布之前,他们会根据标准的变化工作草案更改一些细节。



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


I know those flags are for C++11 in Eclipse.

But I don't know what is difference and which one is more preferred.

It seems that they both are working with C++11 normally.

解决方案

You should prefer -std=c++11.

(Note: I assume -std=c++11x is a typo in your question)

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之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆