目录
文章目录
#####1.在linux采用c++11新特性编写的代码用g++编译时候,默认是不支持的#####
编译时候会提示不支持
c++11
的提示。比如下面提示:
newFeature.cpp:14:41: error: in C++98 ‘vec’ must be initialized by constructor, not by ‘{...}’
(1)为了让g++
能够支持和编译c++11
新特性代码,需在编译时候加上指定条件:-std=c++11
//显示指定用c++11新特性来编译;没有报错
lxg@Ubuntu:~/code/2018-04-15$ g++ newFeature.cpp