如何在Clang中使用C ++ 11功能? [英] How can I use C++ 11 features in Clang?

查看:384
本文介绍了如何在Clang中使用C ++ 11功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在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中最相关的功能集。有关最新支持的完整列表,请参阅 http://clang.llvm.org/cxx_status.html 特征。 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功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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