OS-X支持std :: tr1 [英] OS-X support for std::tr1

查看:164
本文介绍了OS-X支持std :: tr1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前对于tr1或Mac上的新C ++ 0x的支持

What is the current support for tr1 or the new C++0x on the Mac

我知道XCode附带的gcc总是有几个版本可以从gcc.gnu.org得到,所以我只是想知道现代支持的状态是什么。

I know that the gcc supplied with XCode is always a couple of versions behind that available from gcc.gnu.org so I was just wondering what the state of play for modern support was.

例如,我需要下载boost使用shared_ptr或我可以从std :: tr1吗?

For example do I need to download boost to use shared_ptr or can I get it from std::tr1?

推荐答案

OS X 10.6附带g ++ 4.2.1以及g ++ 4.0,但它应该是直接安装自己的构建,如果你选择。 GNU工具是真棒的。这是建立在我的机器上,一个雪豹Mac与g ++ 4.2.1:

OS X 10.6 ships with g++ 4.2.1 as well as g++ 4.0, but it should be straightforward to install your own build if you choose to. GNU tools are awesome for that. This builds on my machine, a Snow Leopard Mac with g++ 4.2.1:

#include <tr1/memory>

int main(int argc, char* argv[])
{
    std::tr1::shared_ptr<int> p;
    return 0;
}

这篇关于OS-X支持std :: tr1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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