使用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