aboutsummaryrefslogtreecommitdiff
path: root/src/util/memory.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-06-05 22:49:18 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-11-18 15:15:37 +0100
commitfac71987281077aed7f79dce99f4eb3e8a91916a (patch)
tree3cff2c0ba3aa58c455238bb8d32c108d20d700c7 /src/util/memory.h
parentfaaee810e62d796d66bfb2bc4e53c8b4c8104d13 (diff)
Use std::make_unique
Diffstat (limited to 'src/util/memory.h')
-rw-r--r--src/util/memory.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/memory.h b/src/util/memory.h
index 15ecf8f80d..4d73b32869 100644
--- a/src/util/memory.h
+++ b/src/util/memory.h
@@ -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