diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a8ccaa8..4a923b40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,9 +31,7 @@ message(STATUS ${VULKAN_LIB}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOMINMAX -D_USE_MATH_DEFINES") add_definitions(-D_CRT_SECURE_NO_WARNINGS) -add_definitions(-std=c++14) -add_definitions(-std=c++0x) -add_definitions(-std=gnu++14) +add_definitions(-std=c++11) file(GLOB SOURCE *.cpp base/*.cpp) diff --git a/base/threadpool.hpp b/base/threadpool.hpp index 558f5484..c2feea11 100644 --- a/base/threadpool.hpp +++ b/base/threadpool.hpp @@ -12,6 +12,14 @@ #include #include +// make_unique is not available in C++11 +// Taken from Herb Sutter's blog (https://herbsutter.com/gotw/_102/) +template +std::unique_ptr make_unique(Args&& ...args) +{ + return std::unique_ptr(new T(std::forward(args)...)); +} + namespace vkTools { class Thread @@ -95,7 +103,7 @@ namespace vkTools threads.clear(); for (auto i = 0; i < count; i++) { - threads.push_back(std::make_unique()); + threads.push_back(make_unique()); } }