Can i use the latest features of C++11 in XCode 4 or OSX Lion?(我可以在 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 的最新功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我可以在 XCode 4 或 OSX Lion 中使用 C++11 的最新功能
基础教程推荐
- 初始化列表*参数*评估顺序 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- CString 到 char* 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
