diff --git a/library/Core.cpp b/library/Core.cpp index 8d632e107..e4713c07f 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -1404,7 +1404,7 @@ Core::~Core() } Core::Core() : - d(dts::make_unique()), + d(std::make_unique()), script_path_mutex{}, HotkeyMutex{}, HotkeyCond{}, @@ -1501,7 +1501,7 @@ bool Core::InitMainThread() { #else const char * path = "hack\\symbols.xml"; #endif - auto local_vif = dts::make_unique(); + auto local_vif = std::make_unique(); std::cerr << "Identifying DF version.\n"; try { @@ -1517,7 +1517,7 @@ bool Core::InitMainThread() { return false; } vif = std::move(local_vif); - auto local_p = dts::make_unique(*vif); + auto local_p = std::make_unique(*vif); local_p->ValidateDescriptionOS(); vinfo = local_p->getDescriptor(); diff --git a/library/include/MiscUtils.h b/library/include/MiscUtils.h index d14bdb6e9..59adcdbe5 100644 --- a/library/include/MiscUtils.h +++ b/library/include/MiscUtils.h @@ -61,28 +61,6 @@ namespace DFHack { class color_ostream; } -/*! \namespace dts - * std.reverse() == dts, The namespace that include forward compatible helpers - * which can be used from newer standards. The preprocessor check prefers - * standard version if one is available. The standard version gets imported with - * using. - */ -namespace dts { -// Check if lib supports the feature test macro or version is over c++14. -#if __cpp_lib_make_unique < 201304 && __cplusplus < 201402L -//! Insert c++14 make_unique to be forward compatible. Array versions are -//! missing -template -typename std::enable_if::value, std::unique_ptr >::type -make_unique(Args&&... args) -{ - return std::unique_ptr{new T{std::forward(args)...}}; -} -#else /* >= c++14 */ -using std::make_unique; -#endif -} - template void print_bits ( T val, std::ostream& out ) { diff --git a/library/modules/Graphic.cpp b/library/modules/Graphic.cpp index 7f6b8f4d3..b55ee83ed 100644 --- a/library/modules/Graphic.cpp +++ b/library/modules/Graphic.cpp @@ -44,7 +44,7 @@ using namespace DFHack; std::unique_ptr DFHack::createGraphic() { - return dts::make_unique(); + return std::make_unique(); } bool Graphic::Register(DFTileSurface* (*func)(int,int)) diff --git a/library/modules/Materials.cpp b/library/modules/Materials.cpp index 7a1ef249f..7922b5417 100644 --- a/library/modules/Materials.cpp +++ b/library/modules/Materials.cpp @@ -604,7 +604,7 @@ bool DFHack::isStoneInorganic(int material) std::unique_ptr DFHack::createMaterials() { - return dts::make_unique(); + return std::make_unique(); } Materials::Materials() diff --git a/plugins/autofarm.cpp b/plugins/autofarm.cpp index 44253b2f9..e1511153c 100644 --- a/plugins/autofarm.cpp +++ b/plugins/autofarm.cpp @@ -436,7 +436,7 @@ DFhackCExport command_result plugin_init(color_ostream& out, std::vector ()); + autofarmInstance = std::move(std::make_unique()); autofarmInstance->load_state(out); return CR_OK; } diff --git a/plugins/tailor.cpp b/plugins/tailor.cpp index 2b44d11ae..df8781caa 100644 --- a/plugins/tailor.cpp +++ b/plugins/tailor.cpp @@ -588,7 +588,7 @@ static int do_cycle(color_ostream &out); DFhackCExport command_result plugin_init(color_ostream &out, std::vector &commands) { DEBUG(config,out).print("initializing %s\n", plugin_name); - tailor_instance = dts::make_unique(); + tailor_instance = std::make_unique(); // provide a configuration interface for the plugin commands.push_back(PluginCommand(