问题描述
如何在Clang中使用最新的C ++ 11功能?
How can I use the latest C++ 11 features in Clang? What (sub)set of features is supported?
推荐答案
您需要clang 3.3才能使用C ++ 11中最相关的功能集。有关最新支持的完整列表,请参阅特征。 Clang 3.3声明是C ++ 11的功能完整。
You will need clang 3.3 to use the most relevant feature set from C++ 11. Read http://clang.llvm.org/cxx_status.html for the complete list of up-to-date supported features. Clang 3.3 is claimed to be C++11 feature complete.
Clang的命令行是gcc兼容的,因此您必须通过followinf命令启用C ++ 11支持,线路开关
Clang's command line is gcc-compatible so you have to enable C++11 support via the followinf command-line switch
-std=c++11
Clang 3.3支持一系列后C ++ 11特性(如decltype(auto),成员初始化和聚合)。使用此命令行开关启用它们
There is also a bunch of post-C++11 features (like decltype(auto), member initializers and aggregates) that are supported by Clang 3.3. Use this command line switch to enable them
-std=c++1y
这篇关于如何在Clang中使用C ++ 11功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!