mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Declare single-argument (non-converting) constructors "explicit"
In order to avoid unintended implicit conversions.
This commit is contained in:
@@ -111,7 +111,7 @@ public:
|
||||
class uint160 : public base_blob<160> {
|
||||
public:
|
||||
uint160() {}
|
||||
uint160(const base_blob<160>& b) : base_blob<160>(b) {}
|
||||
explicit uint160(const base_blob<160>& b) : base_blob<160>(b) {}
|
||||
explicit uint160(const std::vector<unsigned char>& vch) : base_blob<160>(vch) {}
|
||||
};
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
class uint256 : public base_blob<256> {
|
||||
public:
|
||||
uint256() {}
|
||||
uint256(const base_blob<256>& b) : base_blob<256>(b) {}
|
||||
explicit uint256(const base_blob<256>& b) : base_blob<256>(b) {}
|
||||
explicit uint256(const std::vector<unsigned char>& vch) : base_blob<256>(vch) {}
|
||||
|
||||
/** A cheap hash function that just returns 64 bits from the result, it can be
|
||||
|
||||
Reference in New Issue
Block a user