use make_unique

This commit is contained in:
gabime
2018-09-01 21:30:05 +03:00
parent f4bbe8b2b3
commit ebce97947d
3 changed files with 51 additions and 39 deletions

View File

@@ -174,4 +174,17 @@ using filename_t = std::string;
{ \
err_handler_("Unknown exeption in logger"); \
}
//
// make_unique support
//
#if __cplusplus >= 201402L // C++14 and beyond
using std::make_unique;
#else
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args &&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#endif
} // namespace spdlog