我可以在 XCode 4 或 OSX Lion 中使用 C++11 的最新功能吗? [英] Can i use the latest features of C++11 in XCode 4 or OSX Lion?

查看:18
本文介绍了我可以在 XCode 4 或 OSX Lion 中使用 C++11 的最新功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
我可以在 Xcode 中使用 C++11 吗?

似乎 xcode 4 包含旧版本的 clang 和 gcc.我可以升级 gcc 或 clang 并将它们与 xcode 4 一起使用吗?我想使用 gcc >= 4.6 或最新的 clang.

It seems like xcode 4 contains older versions of clang and gcc. Can i uppgrade gcc or clang and use them with xcode 4? I would like to use gcc >= 4.6 or the latest clang.

我的主要目标是在 mac osx lion 上编程 C++ 时,能够尽可能多地使用 C++11 中的新功能,因此如果需要,放弃 xcode 也是一种选择.

My main goal is to be able to have as much of the new features from C++11 available when programming C++ on mac osx lion so ditching xcode is also an option if that is needed.

我有哪些选择来实现这一目标?

What are my options to achieve this?

推荐答案

Xcode 4.1 中的 clang 版本确实支持一些 C++11 特性,包括可变参数模板和右值引用.libc++,C++11 标准库的实现也包含在 Lion 中.

The version of clang in Xcode 4.1 does support some C++11 features, including variadic templates and rvalue references. Also libc++, an implementation of the C++11 standard library is included in Lion.

查看我对 Osx Lion:Xcode 4.1 如何设置 c++0x 项目了解设置详情.

See my answer to Osx Lion: Xcode 4.1 how do I setup a c++0x project for details on setting this up.

这篇关于我可以在 XCode 4 或 OSX Lion 中使用 C++11 的最新功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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