Bitcoin Core  21.99.0
P2P Digital Currency
memory.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2020 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_UTIL_MEMORY_H
7 #define BITCOIN_UTIL_MEMORY_H
8 
9 #include <memory>
10 #include <utility>
11 
14 template <typename T, typename... Args>
15 std::unique_ptr<T> MakeUnique(Args&&... args)
16 {
17  return std::make_unique<T>(std::forward<Args>(args)...);
18 }
19 
20 #endif
MakeUnique
std::unique_ptr< T > MakeUnique(Args &&... args)
Substitute for C++14 std::make_unique.
Definition: memory.h:15