mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 11:29:01 +08:00
use make_unique
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user