mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
Merge bitcoin/bitcoin#31464: util: Add missing types in make_secure_unique
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Win64 native, VS 2022 (push) Waiting to run
CI / Win64 native fuzz, VS 2022 (push) Waiting to run
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
fa397177ac
util: Add missing types in make_secure_unique (MarcoFalke) Pull request description: The return type of `std::forward` depends on the template type, and can not be recovered from the args. Attempting to do so will result in a compile failure. For example, `make_secure_unique<std::string>(std::string{});` does not compile on current master, but does with this pull. Another example would be `make_secure_unique<std::pair<std::string, std::unique_ptr<int>>>(std::string{}, std::make_unique<int>(21));` ACKs for top commit: hodlinator: ACKfa397177ac
hebasto: ACKfa397177ac
. TheCharlatan: ACKfa397177ac
Tree-SHA512: cc902c1111c929a79a6f806b5097136a465e8c727474176bad30a5777ebbb30bedb0bd35273b43bf839d2c00492500ddec724bd17349250451f6b329cb71e6f2
This commit is contained in:
commit
41a2ce9b7d
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2021 The Bitcoin Core developers
|
||||
// Copyright (c) 2009-present The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
|
@ -74,7 +74,7 @@ secure_unique_ptr<T> make_secure_unique(Args&&... as)
|
|||
|
||||
// initialize in place, and return as secure_unique_ptr
|
||||
try {
|
||||
return secure_unique_ptr<T>(new (p) T(std::forward(as)...));
|
||||
return secure_unique_ptr<T>(new (p) T(std::forward<Args>(as)...));
|
||||
} catch (...) {
|
||||
secure_allocator<T>().deallocate(p, 1);
|
||||
throw;
|
||||
|
|
Loading…
Reference in a new issue