mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Add MakeUnique (substitute for C++14 std::make_unique)
From @ryanofsky:s #10973. Thanks!
This commit is contained in:
parent
d223bc940a
commit
86179897e2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user