Since Xcode 5.1 includes clang 3.4, it should be possible to use std::make_unique. It seems to be defined in memory.h.

However, it needs to have _LIBCPP_STD_VER > 11 but it is still set to 11 because of the value of __cplusplus macro (still 201103L).

Is there a way to change this?

有帮助吗?

解决方案

As specified in the clang website, you need to enable -std=c++1y.

Xcode does not include this option as a choice in its "C++ Language Version" option, so you will need to manually enter it. To do this, you need to go into the "Editor" menu while the project definition is open and press "Show Definitions". You should now be able to manually change the "C++ Language Dialect" option to c++1y:

Enabling "Show Definitions"

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top