Xcode 5.1启用C ++ 14 [英] Xcode 5.1 enable C++14

查看:447
本文介绍了Xcode 5.1启用C ++ 14的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Clang 3.4的Xcode 5.1。和Clang 3.4支持C ++ 14。

Xcode 5.1 using Clang 3.4. And Clang 3.4 supports C++14.

但是,我一直在浏览所有的Xcode选项,没有看到启用C ++ 14的方法。

However, I've been surfing though all of the Xcode options and don't see a way to enable C++14.

我试图启用C ++ 14的放松的 constexpr 功能

I'm trying to enable the relaxed constexpr feature of C++14

推荐答案

要使其工作,您首先将C ++语言方言设置为编译器默认值。然后在其他C ++标志中添加-std = c ++ 1y。

To get this to work, you first set "C++ Language Dialect" to "compiler default". Then in "Other C++ flags" add "-std=c++1y".

这将允许Clang ++用Xcode中的c ++ 14编译。我用Xcode 5.1.1使用用于basic_string的新用户定义文字测试了这个:

This will allow Clang++ to compile with c++14 from within Xcode. I tested this with Xcode 5.1.1 using the new user defined literal for basic_string:

std::string word = "hello"s;

更新:从Xcode 6开始,c ++ 14可用作一等语言方言。

Update: As of Xcode 6, c++14 is available as a first-class language dialect.

这篇关于Xcode 5.1启用C ++ 14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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