mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Declare single-argument (non-converting) constructors "explicit"
In order to avoid unintended implicit conversions.
This commit is contained in:
@@ -22,7 +22,7 @@ static const size_t DBWRAPPER_PREALLOC_VALUE_SIZE = 1024;
|
||||
class dbwrapper_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
dbwrapper_error(const std::string& msg) : std::runtime_error(msg) {}
|
||||
explicit dbwrapper_error(const std::string& msg) : std::runtime_error(msg) {}
|
||||
};
|
||||
|
||||
class CDBWrapper;
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
/**
|
||||
* @param[in] _parent CDBWrapper that this batch is to be submitted to
|
||||
*/
|
||||
CDBBatch(const CDBWrapper &_parent) : parent(_parent), ssKey(SER_DISK, CLIENT_VERSION), ssValue(SER_DISK, CLIENT_VERSION), size_estimate(0) { };
|
||||
explicit CDBBatch(const CDBWrapper &_parent) : parent(_parent), ssKey(SER_DISK, CLIENT_VERSION), ssValue(SER_DISK, CLIENT_VERSION), size_estimate(0) { };
|
||||
|
||||
void Clear()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user