mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #13769: Mark single-argument constructors "explicit"
1ac3c983bf Mark single-argument constructors "explicit" (practicalswift)
Pull request description:
Mark single-argument constructors `explicit`.
Rationale:
* Avoid unexpected implicit promotions.
From the developer notes:
> **By default, declare single-argument constructors explicit.**
> Rationale: This is a precaution to avoid unintended conversions that might arise when single-argument constructors are used as implicit conversion functions.
Tree-SHA512: 7901ed5be808c9d0ecb5ca501e1bc0395987fe1b7941b8548cebac2ff08a14f7dab61fab374a69b9ba29a9295a04245c814325c7f95b97ae558af0780f111dfa
This commit is contained in:
@@ -15,7 +15,7 @@ namespace {
|
||||
class HandlerImpl : public Handler
|
||||
{
|
||||
public:
|
||||
HandlerImpl(boost::signals2::connection connection) : m_connection(std::move(connection)) {}
|
||||
explicit HandlerImpl(boost::signals2::connection connection) : m_connection(std::move(connection)) {}
|
||||
|
||||
void disconnect() override { m_connection.disconnect(); }
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace {
|
||||
class PendingWalletTxImpl : public PendingWalletTx
|
||||
{
|
||||
public:
|
||||
PendingWalletTxImpl(CWallet& wallet) : m_wallet(wallet), m_key(&wallet) {}
|
||||
explicit PendingWalletTxImpl(CWallet& wallet) : m_wallet(wallet), m_key(&wallet) {}
|
||||
|
||||
const CTransaction& get() override { return *m_tx; }
|
||||
|
||||
@@ -117,7 +117,7 @@ static WalletTxOut MakeWalletTxOut(CWallet& wallet, const CWalletTx& wtx, int n,
|
||||
class WalletImpl : public Wallet
|
||||
{
|
||||
public:
|
||||
WalletImpl(const std::shared_ptr<CWallet>& wallet) : m_shared_wallet(wallet), m_wallet(*wallet.get()) {}
|
||||
explicit WalletImpl(const std::shared_ptr<CWallet>& wallet) : m_shared_wallet(wallet), m_wallet(*wallet.get()) {}
|
||||
|
||||
bool encryptWallet(const SecureString& wallet_passphrase) override
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user