Skip to content

Commit fac7198

Browse files
author
MarcoFalke
committed
Use std::make_unique
1 parent faaee81 commit fac7198

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/memory.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
#include <utility>
1111

1212
//! Substitute for C++14 std::make_unique.
13+
//! DEPRECATED use std::make_unique in new code.
1314
template <typename T, typename... Args>
1415
std::unique_ptr<T> MakeUnique(Args&&... args)
1516
{
16-
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
17+
return std::make_unique<T>(std::forward<Args>(args)...);
1718
}
1819

1920
#endif

0 commit comments

Comments
 (0)