OS-X support for std::tr1

蓝咒 提交于 2019-12-23 08:54:29

问题


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

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.

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


回答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;
}


来源:https://stackoverflow.com/questions/4414214/os-x-support-for-stdtr1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!