Use std::make_unique

This commit is contained in:
MarcoFalke 2020-06-05 22:49:18 +02:00
parent faaee810e6
commit fac7198728
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -10,10 +10,11 @@
#include <utility>
//! Substitute for C++14 std::make_unique.
//! DEPRECATED use std::make_unique in new code.
template <typename T, typename... Args>
std::unique_ptr<T> MakeUnique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
return std::make_unique<T>(std::forward<Args>(args)...);
}
#endif