Mark some single-argument constructors explicit

This commit is contained in:
Joe Loser
2018-05-20 22:23:44 -04:00
committed by Mike Ellery
parent 31e511afcf
commit f658656b82
11 changed files with 20 additions and 20 deletions

View File

@@ -98,7 +98,7 @@ public:
Collector::ptr m_collector; Collector::ptr m_collector;
Items m_items; Items m_items;
GroupsImp (Collector::ptr const& collector) explicit GroupsImp (Collector::ptr const& collector)
: m_collector (collector) : m_collector (collector)
{ {
} }

View File

@@ -82,7 +82,7 @@ private:
sys_seconds sent; sys_seconds sent;
std::uint32_t nonce; std::uint32_t nonce;
Query (sys_seconds j = sys_seconds::max()) explicit Query (sys_seconds j = sys_seconds::max())
: replied (false) : replied (false)
, sent (j) , sent (j)
{ {

View File

@@ -327,7 +327,7 @@ struct transactionPreProcessResult
, second () , second ()
{ } { }
transactionPreProcessResult (std::shared_ptr<STTx>&& st) explicit transactionPreProcessResult (std::shared_ptr<STTx>&& st)
: first () : first ()
, second (std::move (st)) , second (std::move (st))
{ } { }

View File

@@ -49,7 +49,7 @@ create (jtx::Account const& account,
struct DeliverMin struct DeliverMin
{ {
STAmount value; STAmount value;
DeliverMin (STAmount const& deliverMin) explicit DeliverMin (STAmount const& deliverMin)
: value (deliverMin) { } : value (deliverMin) { }
}; };
@@ -101,7 +101,7 @@ private:
std::uint32_t const expry_; std::uint32_t const expry_;
public: public:
expiration (NetClock::time_point const& expiry) explicit expiration (NetClock::time_point const& expiry)
: expry_{expiry.time_since_epoch().count()} : expry_{expiry.time_since_epoch().count()}
{ {
} }
@@ -120,7 +120,7 @@ private:
std::uint32_t const tag_; std::uint32_t const tag_;
public: public:
source_tag (std::uint32_t tag) explicit source_tag (std::uint32_t tag)
: tag_{tag} : tag_{tag}
{ {
} }
@@ -139,7 +139,7 @@ private:
std::uint32_t const tag_; std::uint32_t const tag_;
public: public:
dest_tag (std::uint32_t tag) explicit dest_tag (std::uint32_t tag)
: tag_{tag} : tag_{tag}
{ {
} }
@@ -158,7 +158,7 @@ private:
uint256 const id_; uint256 const id_;
public: public:
invoice_id (uint256 const& id) explicit invoice_id (uint256 const& id)
: id_{id} : id_{id}
{ {
} }

View File

@@ -127,7 +127,7 @@ struct Escrow_test : public beast::unit_test::suite
} }
template <size_t N> template <size_t N>
condition (std::array<std::uint8_t, N> c) explicit condition (std::array<std::uint8_t, N> c)
: condition(makeSlice(c)) : condition(makeSlice(c))
{ {
} }
@@ -152,7 +152,7 @@ struct Escrow_test : public beast::unit_test::suite
} }
template <size_t N> template <size_t N>
fulfillment (std::array<std::uint8_t, N> f) explicit fulfillment (std::array<std::uint8_t, N> f)
: fulfillment(makeSlice(f)) : fulfillment(makeSlice(f))
{ {
} }

View File

@@ -363,7 +363,7 @@ struct ExistingElementPool
ExistingElementPool& p_; ExistingElementPool& p_;
ResetState state_; ResetState state_;
StateGuard(ExistingElementPool& p) : p_{p}, state_{p.getResetState()} explicit StateGuard(ExistingElementPool& p) : p_{p}, state_{p.getResetState()}
{ {
} }
~StateGuard() ~StateGuard()

View File

@@ -244,7 +244,7 @@ class Validations_test : public beast::unit_test::suite
PeerID nextNodeId_{0}; PeerID nextNodeId_{0};
public: public:
TestHarness(LedgerOracle& o) explicit TestHarness(LedgerOracle& o)
: tv_(p_, clock_, staleData_, clock_, o) : tv_(p_, clock_, staleData_, clock_, o)
{ {
} }

View File

@@ -400,7 +400,7 @@ class Stoppable_test
C c_; C c_;
Stoppable_test& test_; Stoppable_test& test_;
public: public:
Root(Stoppable_test& test) explicit Root(Stoppable_test& test)
: RootStoppable("R") : RootStoppable("R")
, a_(&A::run, std::make_unique<A>(*this, test)) , a_(&A::run, std::make_unique<A>(*this, test))
, b_(*this, test) , b_(*this, test)

View File

@@ -36,7 +36,7 @@ private:
class CerrRedirect class CerrRedirect
{ {
public: public:
CerrRedirect (std::stringstream& sStream) explicit CerrRedirect (std::stringstream& sStream)
: old_ (std::cerr.rdbuf (sStream.rdbuf())) : old_ (std::cerr.rdbuf (sStream.rdbuf()))
{ } { }
@@ -53,7 +53,7 @@ private:
class ThreadNameGuard class ThreadNameGuard
{ {
public: public:
ThreadNameGuard (std::string const& newName) explicit ThreadNameGuard (std::string const& newName)
: old_ (beast::getCurrentThreadName ()) : old_ (beast::getCurrentThreadName ())
{ {
beast::setCurrentThreadName (newName); beast::setCurrentThreadName (newName);

View File

@@ -87,7 +87,7 @@ private:
Base& base_; Base& base_;
public: public:
Child(Base& base) explicit Child(Base& base)
: base_(base) : base_(base)
{ {
} }
@@ -179,7 +179,7 @@ private:
socket_type socket_; socket_type socket_;
strand_type strand_; strand_type strand_;
Acceptor(Server& server) explicit Acceptor(Server& server)
: Child(server) : Child(server)
, server_(server) , server_(server)
, test_(server_.test_) , test_(server_.test_)
@@ -368,7 +368,7 @@ private:
}; };
public: public:
Server(short_read_test& test) explicit Server(short_read_test& test)
: test_(test) : test_(test)
{ {
auto const p = std::make_shared<Acceptor>(*this); auto const p = std::make_shared<Acceptor>(*this);

View File

@@ -73,7 +73,7 @@ public:
beast::unit_test::suite& suite_; beast::unit_test::suite& suite_;
public: public:
TestSink (beast::unit_test::suite& suite) explicit TestSink (beast::unit_test::suite& suite)
: Sink (beast::severities::kWarning, false) : Sink (beast::severities::kWarning, false)
, suite_ (suite) , suite_ (suite)
{ {
@@ -396,7 +396,7 @@ public:
std::string& result_; std::string& result_;
public: public:
CaptureLogs(std::string& result) explicit CaptureLogs(std::string& result)
: Logs (beast::severities::kInfo) : Logs (beast::severities::kInfo)
, result_(result) , result_(result)
{ {