diff --git a/src/util.h b/src/util.h index 480a80c0a..43acd93ee 100644 --- a/src/util.h +++ b/src/util.h @@ -326,4 +326,11 @@ template void TraceThread(const char* name, Callable func) std::string CopyrightHolders(const std::string& strPrefix); +//! Substitute for C++14 std::make_unique. +template +std::unique_ptr MakeUnique(Args&&... args) +{ + return std::unique_ptr(new T(std::forward(args)...)); +} + #endif // BITCOIN_UTIL_H