From 64fb0ac016c7fd01c60c39af60f6431bac57f9ee Mon Sep 17 00:00:00 2001 From: practicalswift Date: Tue, 1 Aug 2017 12:22:41 +0200 Subject: Declare single-argument (non-converting) constructors "explicit" In order to avoid unintended implicit conversions. --- src/test/blockencodings_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test/blockencodings_tests.cpp') diff --git a/src/test/blockencodings_tests.cpp b/src/test/blockencodings_tests.cpp index 812e8534cd..f2d5b385d0 100644 --- a/src/test/blockencodings_tests.cpp +++ b/src/test/blockencodings_tests.cpp @@ -118,12 +118,12 @@ public: std::vector shorttxids; std::vector prefilledtxn; - TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig) { + explicit TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig) { CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); stream << orig; stream >> *this; } - TestHeaderAndShortIDs(const CBlock& block) : + explicit TestHeaderAndShortIDs(const CBlock& block) : TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs(block, true)) {} uint64_t GetShortID(const uint256& txhash) const { -- cgit v1.2.3