mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-09 04:02:25 +01:00
Declare single-argument (non-converting) constructors "explicit"
In order to avoid unintended implicit conversions.
This commit is contained in:
@@ -1563,7 +1563,7 @@ private:
|
||||
int bit;
|
||||
|
||||
public:
|
||||
WarningBitsConditionChecker(int bitIn) : bit(bitIn) {}
|
||||
explicit WarningBitsConditionChecker(int bitIn) : bit(bitIn) {}
|
||||
|
||||
int64_t BeginTime(const Consensus::Params& params) const override { return 0; }
|
||||
int64_t EndTime(const Consensus::Params& params) const override { return std::numeric_limits<int64_t>::max(); }
|
||||
@@ -2135,7 +2135,7 @@ private:
|
||||
CTxMemPool &pool;
|
||||
|
||||
public:
|
||||
ConnectTrace(CTxMemPool &_pool) : blocksConnected(1), pool(_pool) {
|
||||
explicit ConnectTrace(CTxMemPool &_pool) : blocksConnected(1), pool(_pool) {
|
||||
pool.NotifyEntryRemoved.connect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user