使用Travis-CI
我试图建立一个使用std::make_unique
的C++项目。但是我得到生成错误:如何在叮3.4中使用make_unique?
no member named 'make_unique' in namespace 'std'
mFiles.emplace_back(std::make_unique<File>(*this, rec));
我已经包括memory
,这个代码编译在VS2013和gcc 4.8与-std=c++14
。如果我使用铛3.4这个标志我得到一个错误:
error: invalid value 'c++14' in '-std=c++14'
根据铛文档:
http://clang.llvm.org/cxx_status.html
,我应该使用-std=c++1y
但仍yeilds相同no member named 'make_unique' in namespace 'std'
。那么我如何才能使它工作?
尝试使用-std = C++ 1y改为-std = C++ 14 – senfen 2015-04-03 12:17:46
阅读我的最后一句,这会产生相同的错误 – paulm 2015-04-03 12:18:46
您确定这是一个C++ 14功能吗?我认为它也存在于C++ 11中。试过''-std = C++ 11 -stdlib = libC++''? – BitTickler 2015-04-03 12:22:56