简体   繁体   中英

Is it possible to use std::make_unique in Xcode 5.1?

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 :

启用“显示定义”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM