为什么 -ansi 和 -std=c++11 在 g++ 中发生冲突? [英] Why do -ansi and -std=c++11 conflict in g++?
问题描述
为什么 -ansi 和 -std=c++11 不能一起工作?(ANSI 根据其他答案恢复为 C++98)我正在使用 g++-4.8.
Why does -ansi and -std=c++11 doesn't work together ? (ANSI reverts back to C++98 according to other answers) I am using g++-4.8.
这里是 C++11 的 ANSI 批准:
Here is the ANSI ratification of C++11 :
http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+14882-2012
这让我很困惑.谢谢!
推荐答案
RTFM:
-ansi
在 C 模式下,这相当于 -std=c89
.在C++模式下,相当于-std=c++98
.
-ansi
In C mode, this is equivalent to-std=c89
. In C++ mode, it is equivalent to-std=c++98
.
该标志是在标准有多个版本之前添加的,该标志仍然具有相同的含义.
The flag was added before there were multiple versions of the standard, and the flag still has the same meaning.
你为什么要同时使用两者?如果你想要 -std=c++11
然后使用它,不要添加另一个表示其他矛盾的标志.
Why do you want to use both anyway? If you want -std=c++11
then use that, don't add another flag that means something else contradictory.
这篇关于为什么 -ansi 和 -std=c++11 在 g++ 中发生冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!