mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-20 20:49:50 +01:00
Declare single-argument (non-converting) constructors "explicit"
In order to avoid unintended implicit conversions.
This commit is contained in:
@@ -78,7 +78,7 @@ class TestAddrTypeVisitor : public boost::static_visitor<bool>
|
||||
private:
|
||||
std::string exp_addrType;
|
||||
public:
|
||||
TestAddrTypeVisitor(const std::string &_exp_addrType) : exp_addrType(_exp_addrType) { }
|
||||
explicit TestAddrTypeVisitor(const std::string &_exp_addrType) : exp_addrType(_exp_addrType) { }
|
||||
bool operator()(const CKeyID &id) const
|
||||
{
|
||||
return (exp_addrType == "pubkey");
|
||||
@@ -99,7 +99,7 @@ class TestPayloadVisitor : public boost::static_visitor<bool>
|
||||
private:
|
||||
std::vector<unsigned char> exp_payload;
|
||||
public:
|
||||
TestPayloadVisitor(std::vector<unsigned char> &_exp_payload) : exp_payload(_exp_payload) { }
|
||||
explicit TestPayloadVisitor(std::vector<unsigned char> &_exp_payload) : exp_payload(_exp_payload) { }
|
||||
bool operator()(const CKeyID &id) const
|
||||
{
|
||||
uint160 exp_key(exp_payload);
|
||||
|
||||
Reference in New Issue
Block a user