Add MakeUnique (substitute for C++14 std::make_unique)

From @ryanofsky:s #10973. Thanks!
This commit is contained in:
practicalswift committed 2017-11-09 16:53:34 +01:00
1 parent d223bc940a
commit 86179897e2
1 file changed
+7
+7
View File
@@ -326,4 +326,11 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
std::string CopyrightHolders(const std::string& strPrefix);
//! Substitute for C++14 std::make_unique.
template <typename T, typename... Args>
std::unique_ptr<T> MakeUnique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#endif // BITCOIN_UTIL_H