Does Dev-Cpp 5.11 support C++ 11?

眉间皱痕 提交于 2021-02-08 07:27:56

问题


I struggled to find a clear answer on the first Google page. I have troubles understanding the term "Language standard". I mean, the new standard should be implemented on a software level, right? It's not just a list of things discovered that users can now do, right? I use delegating constructors, get a warning:

[Warning] delegating constructors only available with -std=c++11 or -std=gnu++11

Though things seem to work the way I want them to. Is such warning critical? If so, how do I get rid of it?


回答1:


Dev-Cpp is just IDE (frontend) for coder and behind it sits MinGW with GCC 4.9.2 as compiler*. So every time you click "Run" or "Build" it is GCC to do the dirty job. GCC by default uses C++03 standard and to use newer one you have to tell it explicitly via compiler flag -std=c++11. You can change it in Tools->Compiler Options->Settings->Code generation->Language standard (-std).

I am not sure why delegating constructors could work without C++11 (probably some GCC feature), but for sure you will not be able to use C++11 libraries without -std=c++11. It will also get rid of the warning.

(* Assuming you used default Dev-C++ installer.)



来源:https://stackoverflow.com/questions/50220237/does-dev-cpp-5-11-support-c-11

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!