diff --git a/src/ripple/app/consensus/RCLValidations.h b/src/ripple/app/consensus/RCLValidations.h index 6394408af..8bdc3418a 100644 --- a/src/ripple/app/consensus/RCLValidations.h +++ b/src/ripple/app/consensus/RCLValidations.h @@ -152,6 +152,7 @@ public: using Seq = LedgerIndex; struct MakeGenesis { + explicit MakeGenesis() = default; }; RCLValidatedLedger(MakeGenesis); diff --git a/src/ripple/app/ledger/Ledger.h b/src/ripple/app/ledger/Ledger.h index d0b813865..b2d866f23 100644 --- a/src/ripple/app/ledger/Ledger.h +++ b/src/ripple/app/ledger/Ledger.h @@ -42,7 +42,10 @@ class TransactionMaster; class SqliteStatement; -struct create_genesis_t {}; +struct create_genesis_t +{ + explicit create_genesis_t() = default; +}; extern create_genesis_t const create_genesis; /** Holds a ledger. diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index dc83e9ef9..f659d0048 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -120,6 +120,8 @@ class NetworkOPsImp final { struct Counters { + explicit Counters() = default; + std::uint32_t transitions = 0; std::chrono::microseconds dur = std::chrono::microseconds (0); }; diff --git a/src/ripple/app/misc/SHAMapStore.h b/src/ripple/app/misc/SHAMapStore.h index 67fb0ba9f..da8f320c3 100644 --- a/src/ripple/app/misc/SHAMapStore.h +++ b/src/ripple/app/misc/SHAMapStore.h @@ -39,6 +39,8 @@ class SHAMapStore public: struct Setup { + explicit Setup() = default; + bool standalone = false; std::uint32_t deleteInterval = 0; bool advisoryDelete = false; diff --git a/src/ripple/app/misc/SHAMapStoreImp.h b/src/ripple/app/misc/SHAMapStoreImp.h index 8ce8ec33e..b8bce5a6e 100644 --- a/src/ripple/app/misc/SHAMapStoreImp.h +++ b/src/ripple/app/misc/SHAMapStoreImp.h @@ -57,7 +57,7 @@ private: // Just instantiate without any logic in case online delete is not // configured - SavedStateDB() = default; + explicit SavedStateDB() = default; // opens database and, if necessary, creates & initializes its tables. void init (BasicConfig const& config, std::string const& dbName); diff --git a/src/ripple/app/misc/TxQ.h b/src/ripple/app/misc/TxQ.h index 17e42aa35..6b7770bd1 100644 --- a/src/ripple/app/misc/TxQ.h +++ b/src/ripple/app/misc/TxQ.h @@ -55,6 +55,8 @@ public: struct Setup { + explicit Setup() = default; + std::size_t ledgersInQueue = 20; std::size_t queueSizeMin = 2000; std::uint32_t retrySequencePercent = 25; @@ -81,6 +83,8 @@ public: struct Metrics { + explicit Metrics() = default; + std::size_t txCount; // Transactions in the queue boost::optional txQMaxSize; // Max txns in queue std::size_t txInLedger; // Amount currently in the ledger @@ -93,6 +97,8 @@ public: struct AccountTxDetails { + explicit AccountTxDetails() = default; + uint64_t feeLevel; boost::optional lastValid; boost::optional consequences; @@ -100,6 +106,8 @@ public: struct TxDetails : AccountTxDetails { + explicit TxDetails() = default; + AccountID account; std::shared_ptr txn; int retriesRemaining; @@ -333,6 +341,8 @@ private: class GreaterFee { public: + explicit GreaterFee() = default; + bool operator()(const MaybeTx& lhs, const MaybeTx& rhs) const { return lhs.feeLevel > rhs.feeLevel; diff --git a/src/ripple/app/misc/ValidatorList.h b/src/ripple/app/misc/ValidatorList.h index 0e8b41ff5..d66db9ee4 100644 --- a/src/ripple/app/misc/ValidatorList.h +++ b/src/ripple/app/misc/ValidatorList.h @@ -64,6 +64,8 @@ to_string(ListDisposition disposition); */ struct TrustChanges { + explicit TrustChanges() = default; + hash_set added; hash_set removed; }; @@ -115,6 +117,8 @@ class ValidatorList { struct PublisherList { + explicit PublisherList() = default; + bool available; std::vector list; std::size_t sequence; diff --git a/src/ripple/app/misc/impl/AmendmentTable.cpp b/src/ripple/app/misc/impl/AmendmentTable.cpp index bb6d3ba1d..c460d69c9 100644 --- a/src/ripple/app/misc/impl/AmendmentTable.cpp +++ b/src/ripple/app/misc/impl/AmendmentTable.cpp @@ -91,7 +91,7 @@ struct AmendmentState /** The name of this amendment, possibly empty. */ std::string name; - AmendmentState () = default; + explicit AmendmentState () = default; }; /** The status of all amendments requested in a given window. */ diff --git a/src/ripple/app/misc/impl/TxQ.cpp b/src/ripple/app/misc/impl/TxQ.cpp index 444c73a27..224103bc2 100644 --- a/src/ripple/app/misc/impl/TxQ.cpp +++ b/src/ripple/app/misc/impl/TxQ.cpp @@ -636,6 +636,8 @@ TxQ::apply(Application& app, OpenView& view, struct MultiTxn { + explicit MultiTxn() = default; + boost::optional applyView; boost::optional openView; diff --git a/src/ripple/app/paths/Node.h b/src/ripple/app/paths/Node.h index 2c56420f7..50e08fa82 100644 --- a/src/ripple/app/paths/Node.h +++ b/src/ripple/app/paths/Node.h @@ -31,6 +31,8 @@ namespace path { struct Node { + explicit Node() = default; + using List = std::vector; inline bool isAccount() const diff --git a/src/ripple/app/paths/NodeDirectory.h b/src/ripple/app/paths/NodeDirectory.h index b5dd6e2e5..e32d3b46c 100644 --- a/src/ripple/app/paths/NodeDirectory.h +++ b/src/ripple/app/paths/NodeDirectory.h @@ -31,6 +31,8 @@ namespace ripple { class NodeDirectory { public: + explicit NodeDirectory() = default; + // Current directory - the last 64 bits of this are the quality. uint256 current; diff --git a/src/ripple/app/paths/RippleCalc.h b/src/ripple/app/paths/RippleCalc.h index 787c3a477..a00a2dcda 100644 --- a/src/ripple/app/paths/RippleCalc.h +++ b/src/ripple/app/paths/RippleCalc.h @@ -46,6 +46,8 @@ class RippleCalc public: struct Input { + explicit Input() = default; + bool partialPaymentAllowed = false; bool defaultPathsAllowed = true; bool limitQuality = false; @@ -53,6 +55,8 @@ public: }; struct Output { + explicit Output() = default; + // The computed input amount. STAmount actualAmountIn; diff --git a/src/ripple/app/paths/RippleLineCache.h b/src/ripple/app/paths/RippleLineCache.h index 854fe83db..01fd1aa2b 100644 --- a/src/ripple/app/paths/RippleLineCache.h +++ b/src/ripple/app/paths/RippleLineCache.h @@ -81,6 +81,8 @@ private: struct Hash { + explicit Hash() = default; + std::size_t operator () (AccountKey const& key) const noexcept { diff --git a/src/ripple/app/paths/impl/AmountSpec.h b/src/ripple/app/paths/impl/AmountSpec.h index 57be8e009..52cfbfc81 100644 --- a/src/ripple/app/paths/impl/AmountSpec.h +++ b/src/ripple/app/paths/impl/AmountSpec.h @@ -28,6 +28,8 @@ namespace ripple { struct AmountSpec { + explicit AmountSpec() = default; + bool native; union { diff --git a/src/ripple/app/paths/impl/BookStep.cpp b/src/ripple/app/paths/impl/BookStep.cpp index 6392ac44f..9cf320647 100644 --- a/src/ripple/app/paths/impl/BookStep.cpp +++ b/src/ripple/app/paths/impl/BookStep.cpp @@ -197,6 +197,8 @@ class BookPaymentStep : public BookStep> { public: + explicit BookPaymentStep() = default; + using BookStep>::BookStep; using BookStep>::qualityUpperBound; diff --git a/src/ripple/app/paths/impl/DirectStep.cpp b/src/ripple/app/paths/impl/DirectStep.cpp index 7ca52a296..a75fc5d42 100644 --- a/src/ripple/app/paths/impl/DirectStep.cpp +++ b/src/ripple/app/paths/impl/DirectStep.cpp @@ -221,6 +221,8 @@ private: class DirectIPaymentStep : public DirectStepI { public: + explicit DirectIPaymentStep() = default; + using DirectStepI::DirectStepI; using DirectStepI::check; @@ -264,6 +266,8 @@ public: class DirectIOfferCrossingStep : public DirectStepI { public: + explicit DirectIOfferCrossingStep() = default; + using DirectStepI::DirectStepI; using DirectStepI::check; diff --git a/src/ripple/app/paths/impl/Steps.h b/src/ripple/app/paths/impl/Steps.h index b14f87030..edfeda4c8 100644 --- a/src/ripple/app/paths/impl/Steps.h +++ b/src/ripple/app/paths/impl/Steps.h @@ -375,6 +375,8 @@ toStrands (ReadView const& sb, template struct StepImp : public Step { + explicit StepImp() = default; + std::pair rev ( PaymentSandbox& sb, diff --git a/src/ripple/app/paths/impl/XRPEndpointStep.cpp b/src/ripple/app/paths/impl/XRPEndpointStep.cpp index 9195e46a9..44a391b14 100644 --- a/src/ripple/app/paths/impl/XRPEndpointStep.cpp +++ b/src/ripple/app/paths/impl/XRPEndpointStep.cpp @@ -167,6 +167,8 @@ private: class XRPEndpointPaymentStep : public XRPEndpointStep { public: + explicit XRPEndpointPaymentStep() = default; + using XRPEndpointStep::XRPEndpointStep; XRPAmount diff --git a/src/ripple/app/tx/impl/InvariantCheck.h b/src/ripple/app/tx/impl/InvariantCheck.h index 04cb19360..c494e7470 100644 --- a/src/ripple/app/tx/impl/InvariantCheck.h +++ b/src/ripple/app/tx/impl/InvariantCheck.h @@ -42,6 +42,7 @@ namespace ripple { class InvariantChecker_PROTOTYPE { public: + explicit InvariantChecker_PROTOTYPE() = default; /** * @brief called for each ledger entry in the current transaction. diff --git a/src/ripple/app/tx/impl/Offer.h b/src/ripple/app/tx/impl/Offer.h index d0bae51f0..022da0fe9 100644 --- a/src/ripple/app/tx/impl/Offer.h +++ b/src/ripple/app/tx/impl/Offer.h @@ -41,6 +41,8 @@ protected: template<> class TOfferBase { +public: + explicit TOfferBase() = default; }; diff --git a/src/ripple/app/tx/impl/SignerEntries.h b/src/ripple/app/tx/impl/SignerEntries.h index f42e07391..6a41f8f44 100644 --- a/src/ripple/app/tx/impl/SignerEntries.h +++ b/src/ripple/app/tx/impl/SignerEntries.h @@ -34,6 +34,8 @@ class STObject; class SignerEntries { public: + explicit SignerEntries() = default; + struct SignerEntry { AccountID account; diff --git a/src/ripple/app/tx/impl/Taker.h b/src/ripple/app/tx/impl/Taker.h index ee1706813..a4d9b5157 100644 --- a/src/ripple/app/tx/impl/Taker.h +++ b/src/ripple/app/tx/impl/Taker.h @@ -73,6 +73,8 @@ protected: struct Flow { + explicit Flow() = default; + Amounts order; Amounts issuers; diff --git a/src/ripple/basics/LocalValue.h b/src/ripple/basics/LocalValue.h index 9f7355db4..77c41d2d2 100644 --- a/src/ripple/basics/LocalValue.h +++ b/src/ripple/basics/LocalValue.h @@ -30,6 +30,8 @@ namespace detail { struct LocalValues { + explicit LocalValues() = default; + bool onCoro = true; struct BasicValue diff --git a/src/ripple/basics/ResolverAsio.h b/src/ripple/basics/ResolverAsio.h index d0d89e228..99ebee89e 100644 --- a/src/ripple/basics/ResolverAsio.h +++ b/src/ripple/basics/ResolverAsio.h @@ -29,6 +29,8 @@ namespace ripple { class ResolverAsio : public Resolver { public: + explicit ResolverAsio() = default; + static std::unique_ptr New ( boost::asio::io_service&, beast::Journal); diff --git a/src/ripple/basics/StringUtilities.h b/src/ripple/basics/StringUtilities.h index 911d95170..0bb6c59c1 100644 --- a/src/ripple/basics/StringUtilities.h +++ b/src/ripple/basics/StringUtilities.h @@ -86,6 +86,8 @@ std::pair strUnHex (std::string const& strSrc); struct parsedURL { + explicit parsedURL() = default; + std::string scheme; std::string domain; boost::optional port; diff --git a/src/ripple/basics/base_uint.h b/src/ripple/basics/base_uint.h index 9fbb04a56..f38317da2 100644 --- a/src/ripple/basics/base_uint.h +++ b/src/ripple/basics/base_uint.h @@ -99,6 +99,8 @@ public: class key_equal { public: + explicit key_equal() = default; + bool operator() (base_uint const& lhs, base_uint const& rhs) const { return lhs == rhs; @@ -115,7 +117,10 @@ private: constructor: something like base_uint(0) is ambiguous. */ // NIKB TODO Remove the need for this constructor. - struct VoidHelper {}; + struct VoidHelper + { + explicit VoidHelper() = default; + }; explicit base_uint (void const* data, VoidHelper) { @@ -578,7 +583,9 @@ namespace beast template struct is_uniquely_represented> : public std::true_type - {}; + { + explicit is_uniquely_represented() = default; + }; } // beast diff --git a/src/ripple/basics/chrono.h b/src/ripple/basics/chrono.h index de3160110..6041d798d 100644 --- a/src/ripple/basics/chrono.h +++ b/src/ripple/basics/chrono.h @@ -48,6 +48,8 @@ using weeks = std::chrono::duration class NetClock { public: + explicit NetClock() = default; + using rep = std::uint32_t; using period = std::ratio<1>; using duration = std::chrono::duration; diff --git a/src/ripple/basics/hardened_hash.h b/src/ripple/basics/hardened_hash.h index 3ef8bdf20..88c32698b 100644 --- a/src/ripple/basics/hardened_hash.h +++ b/src/ripple/basics/hardened_hash.h @@ -90,6 +90,8 @@ private: } public: + explicit basic_hardened_hash() = default; + using result_type = typename HashAlgorithm::result_type; template diff --git a/src/ripple/basics/impl/make_SSLContext.cpp b/src/ripple/basics/impl/make_SSLContext.cpp index 0d3270df2..b1812fa8a 100644 --- a/src/ripple/basics/impl/make_SSLContext.cpp +++ b/src/ripple/basics/impl/make_SSLContext.cpp @@ -44,6 +44,8 @@ struct custom_delete; template <> struct custom_delete { + explicit custom_delete() = default; + void operator() (RSA* rsa) const { RSA_free (rsa); @@ -53,6 +55,8 @@ struct custom_delete template <> struct custom_delete { + explicit custom_delete() = default; + void operator() (EVP_PKEY* evp_pkey) const { EVP_PKEY_free (evp_pkey); @@ -62,6 +66,8 @@ struct custom_delete template <> struct custom_delete { + explicit custom_delete() = default; + void operator() (X509* x509) const { X509_free (x509); @@ -71,6 +77,8 @@ struct custom_delete template <> struct custom_delete { + explicit custom_delete() = default; + void operator() (DH* dh) const { DH_free (dh); diff --git a/src/ripple/basics/qalloc.h b/src/ripple/basics/qalloc.h index bb2be4498..7f103a0d8 100644 --- a/src/ripple/basics/qalloc.h +++ b/src/ripple/basics/qalloc.h @@ -111,6 +111,8 @@ public: template struct rebind { + explicit rebind() = default; + using other = qalloc_type; }; diff --git a/src/ripple/basics/tagged_integer.h b/src/ripple/basics/tagged_integer.h index a8b60fc51..5267fa935 100644 --- a/src/ripple/basics/tagged_integer.h +++ b/src/ripple/basics/tagged_integer.h @@ -228,6 +228,7 @@ template struct is_contiguously_hashable, HashAlgorithm> : public is_contiguously_hashable { + explicit is_contiguously_hashable() = default; }; } // beast diff --git a/src/ripple/beast/clock/abstract_clock.h b/src/ripple/beast/clock/abstract_clock.h index 77e8bf25a..8f4c31910 100644 --- a/src/ripple/beast/clock/abstract_clock.h +++ b/src/ripple/beast/clock/abstract_clock.h @@ -81,6 +81,8 @@ template struct abstract_clock_wrapper : public abstract_clock { + explicit abstract_clock_wrapper() = default; + using typename abstract_clock::duration; using typename abstract_clock::time_point; diff --git a/src/ripple/beast/clock/basic_seconds_clock.h b/src/ripple/beast/clock/basic_seconds_clock.h index 51a9796dd..806205e33 100644 --- a/src/ripple/beast/clock/basic_seconds_clock.h +++ b/src/ripple/beast/clock/basic_seconds_clock.h @@ -155,6 +155,8 @@ template class basic_seconds_clock { public: + explicit basic_seconds_clock() = default; + using rep = typename Clock::rep; using period = typename Clock::period; using duration = typename Clock::duration; diff --git a/src/ripple/beast/container/aged_container.h b/src/ripple/beast/container/aged_container.h index 726dbeb3a..484b59a84 100644 --- a/src/ripple/beast/container/aged_container.h +++ b/src/ripple/beast/container/aged_container.h @@ -28,6 +28,7 @@ template struct is_aged_container : std::false_type { + explicit is_aged_container() = default; }; } diff --git a/src/ripple/beast/container/detail/aged_associative_container.h b/src/ripple/beast/container/detail/aged_associative_container.h index 752fc140c..42d04e192 100644 --- a/src/ripple/beast/container/detail/aged_associative_container.h +++ b/src/ripple/beast/container/detail/aged_associative_container.h @@ -29,6 +29,8 @@ namespace detail { template struct aged_associative_container_extract_t { + explicit aged_associative_container_extract_t() = default; + template decltype (Value::first) const& operator() (Value const& value) const @@ -40,6 +42,8 @@ struct aged_associative_container_extract_t template <> struct aged_associative_container_extract_t { + explicit aged_associative_container_extract_t() = default; + template Value const& operator() (Value const& value) const diff --git a/src/ripple/beast/container/detail/aged_ordered_container.h b/src/ripple/beast/container/detail/aged_ordered_container.h index 08149e61e..8ec880d81 100644 --- a/src/ripple/beast/container/detail/aged_ordered_container.h +++ b/src/ripple/beast/container/detail/aged_ordered_container.h @@ -44,18 +44,24 @@ namespace detail { template struct is_boost_reverse_iterator : std::false_type -{}; +{ + explicit is_boost_reverse_iterator() = default; +}; #if BOOST_VERSION >= 105800 template struct is_boost_reverse_iterator> : std::true_type -{}; +{ + explicit is_boost_reverse_iterator() = default; +}; #else template struct is_boost_reverse_iterator> : std::true_type -{}; +{ + explicit is_boost_reverse_iterator() = default; +}; #endif /** Associative container where each element is also indexed by time. @@ -125,6 +131,8 @@ private: // need to see the container declaration. struct stashed { + explicit stashed() = default; + using value_type = typename aged_ordered_container::value_type; using time_point = typename aged_ordered_container::time_point; }; @@ -1927,6 +1935,7 @@ struct is_aged_container > : std::true_type { + explicit is_aged_container() = default; }; // Free functions diff --git a/src/ripple/beast/container/detail/aged_unordered_container.h b/src/ripple/beast/container/detail/aged_unordered_container.h index 91d404617..7372b6901 100644 --- a/src/ripple/beast/container/detail/aged_unordered_container.h +++ b/src/ripple/beast/container/detail/aged_unordered_container.h @@ -123,6 +123,8 @@ private: // need to see the container declaration. struct stashed { + explicit stashed() = default; + using value_type = typename aged_unordered_container::value_type; using time_point = typename aged_unordered_container::time_point; }; @@ -2514,6 +2516,7 @@ struct is_aged_container > : std::true_type { + explicit is_aged_container() = default; }; // Free functions diff --git a/src/ripple/beast/core/ByteOrder.h b/src/ripple/beast/core/ByteOrder.h index 0206f649c..8d2945d25 100644 --- a/src/ripple/beast/core/ByteOrder.h +++ b/src/ripple/beast/core/ByteOrder.h @@ -204,6 +204,8 @@ namespace detail template struct SwapBytes { + explicit SwapBytes() = default; + inline IntegralType operator() (IntegralType value) const noexcept { return ByteOrder::swap (value); @@ -215,6 +217,8 @@ struct SwapBytes template <> struct SwapBytes { + explicit SwapBytes() = default; + inline std::int16_t operator() (std::int16_t value) const noexcept { return static_cast (ByteOrder::swap (static_cast (value))); @@ -224,6 +228,8 @@ struct SwapBytes template <> struct SwapBytes { + explicit SwapBytes() = default; + inline std::int32_t operator() (std::int32_t value) const noexcept { return static_cast (ByteOrder::swap (static_cast (value))); @@ -233,6 +239,8 @@ struct SwapBytes template <> struct SwapBytes { + explicit SwapBytes() = default; + inline std::int64_t operator() (std::int64_t value) const noexcept { return static_cast (ByteOrder::swap (static_cast (value))); diff --git a/src/ripple/beast/core/LexicalCast.h b/src/ripple/beast/core/LexicalCast.h index 03cd75077..c20015a4f 100644 --- a/src/ripple/beast/core/LexicalCast.h +++ b/src/ripple/beast/core/LexicalCast.h @@ -141,6 +141,8 @@ struct LexicalCast; template struct LexicalCast { + explicit LexicalCast() = default; + template std::enable_if_t ::value, bool> operator () (std::string& out, Arithmetic in) @@ -163,6 +165,8 @@ struct LexicalCast template struct LexicalCast { + explicit LexicalCast() = default; + static_assert (std::is_integral ::value, "beast::LexicalCast can only be used with integral types"); @@ -212,6 +216,8 @@ struct LexicalCast template struct LexicalCast { + explicit LexicalCast() = default; + bool operator() (Out& out, char const* in) const { return LexicalCast ()(out, in); @@ -223,6 +229,8 @@ struct LexicalCast template struct LexicalCast { + explicit LexicalCast() = default; + bool operator() (Out& out, char* in) const { return LexicalCast ()(out, in); @@ -242,6 +250,7 @@ struct LexicalCast */ struct BadLexicalCast : public std::bad_cast { + explicit BadLexicalCast() = default; }; /** Intelligently convert from one type to another. diff --git a/src/ripple/beast/core/List.h b/src/ripple/beast/core/List.h index 753de9337..ee4018e25 100644 --- a/src/ripple/beast/core/List.h +++ b/src/ripple/beast/core/List.h @@ -37,12 +37,16 @@ namespace detail { template struct CopyConst { + explicit CopyConst() = default; + using type = typename std::remove_const ::type; }; template struct CopyConst { + explicit CopyConst() = default; + using type = typename std::remove_const ::type const; }; /** @} */ diff --git a/src/ripple/beast/crypto/detail/ripemd_context.h b/src/ripple/beast/crypto/detail/ripemd_context.h index 0b89921bb..86ff6c585 100644 --- a/src/ripple/beast/crypto/detail/ripemd_context.h +++ b/src/ripple/beast/crypto/detail/ripemd_context.h @@ -56,6 +56,8 @@ namespace detail { struct ripemd160_context { + explicit ripemd160_context() = default; + static unsigned int const block_size = 64; static unsigned int const digest_size = 20; diff --git a/src/ripple/beast/crypto/detail/sha2_context.h b/src/ripple/beast/crypto/detail/sha2_context.h index 6786fca92..2e5948c38 100644 --- a/src/ripple/beast/crypto/detail/sha2_context.h +++ b/src/ripple/beast/crypto/detail/sha2_context.h @@ -69,6 +69,8 @@ namespace detail { struct sha256_context { + explicit sha256_context() = default; + static unsigned int const block_size = 64; static unsigned int const digest_size = 32; @@ -80,6 +82,8 @@ struct sha256_context struct sha512_context { + explicit sha512_context() = default; + static unsigned int const block_size = 128; static unsigned int const digest_size = 64; diff --git a/src/ripple/beast/cxx17/type_traits.h b/src/ripple/beast/cxx17/type_traits.h index 31bec59f6..7b5048c3c 100644 --- a/src/ripple/beast/cxx17/type_traits.h +++ b/src/ripple/beast/cxx17/type_traits.h @@ -49,6 +49,7 @@ struct is_constructible > is_default_constructible ::value && is_default_constructible ::value> { + explicit is_constructible() = default; }; } // std diff --git a/src/ripple/beast/hash/hash_append.h b/src/ripple/beast/hash/hash_append.h index 72f116722..6c2bdc8f0 100644 --- a/src/ripple/beast/hash/hash_append.h +++ b/src/ripple/beast/hash/hash_append.h @@ -99,22 +99,30 @@ struct is_uniquely_represented : public std::integral_constant::value || std::is_enum::value || std::is_pointer::value> -{}; +{ + explicit is_uniquely_represented() = default; +}; template struct is_uniquely_represented : public is_uniquely_represented -{}; +{ + explicit is_uniquely_represented() = default; +}; template struct is_uniquely_represented : public is_uniquely_represented -{}; +{ + explicit is_uniquely_represented() = default; +}; template struct is_uniquely_represented : public is_uniquely_represented -{}; +{ + explicit is_uniquely_represented() = default; +}; // is_uniquely_represented> @@ -124,6 +132,7 @@ struct is_uniquely_represented> is_uniquely_represented::value && sizeof(T) + sizeof(U) == sizeof(std::pair)> { + explicit is_uniquely_represented() = default; }; // is_uniquely_represented> @@ -134,6 +143,7 @@ struct is_uniquely_represented> static_and::value...>::value && static_sum::value == sizeof(std::tuple)> { + explicit is_uniquely_represented() = default; }; // is_uniquely_represented @@ -142,6 +152,7 @@ template struct is_uniquely_represented : public is_uniquely_represented { + explicit is_uniquely_represented() = default; }; // is_uniquely_represented> @@ -151,6 +162,7 @@ struct is_uniquely_represented> : public std::integral_constant::value && sizeof(T)*N == sizeof(std::array)> { + explicit is_uniquely_represented() = default; }; /** Metafunction returning `true` if the type can be hashed in one call. @@ -172,14 +184,18 @@ struct is_contiguously_hashable : public std::integral_constant::value && (sizeof(T) == 1 || HashAlgorithm::endian == endian::native)> -{}; +{ + explicit is_contiguously_hashable() = default; +}; template struct is_contiguously_hashable : public std::integral_constant::value && (sizeof(T) == 1 || HashAlgorithm::endian == endian::native)> -{}; +{ + explicit is_contiguously_hashable() = default; +}; /** @} */ //------------------------------------------------------------------------------ diff --git a/src/ripple/beast/hash/meta.h b/src/ripple/beast/hash/meta.h index 661fe68e7..5f9182bdf 100644 --- a/src/ripple/beast/hash/meta.h +++ b/src/ripple/beast/hash/meta.h @@ -31,12 +31,14 @@ struct static_and : public std::integral_constant < bool, b0 && static_and::value> { + explicit static_and() = default; }; template <> struct static_and<> : public std::true_type { + explicit static_and() = default; }; #ifndef __INTELLISENSE__ @@ -52,12 +54,14 @@ struct static_sum : public std::integral_constant < std::size_t, s0 + static_sum::value> { + explicit static_sum() = default; }; template <> struct static_sum<> : public std::integral_constant { + explicit static_sum() = default; }; #ifndef __INTELLISENSE__ @@ -72,6 +76,7 @@ struct enable_if_lvalue std::is_lvalue_reference::value > { + explicit enable_if_lvalue() = default; }; /** Ensure const reference function parameters are valid lvalues. diff --git a/src/ripple/beast/hash/uhash.h b/src/ripple/beast/hash/uhash.h index 206311bc5..76aa6f15f 100644 --- a/src/ripple/beast/hash/uhash.h +++ b/src/ripple/beast/hash/uhash.h @@ -30,6 +30,8 @@ namespace beast { template struct uhash { + explicit uhash() = default; + using result_type = typename Hasher::result_type; template diff --git a/src/ripple/beast/insight/NullCollector.h b/src/ripple/beast/insight/NullCollector.h index 607544847..36a78c17a 100644 --- a/src/ripple/beast/insight/NullCollector.h +++ b/src/ripple/beast/insight/NullCollector.h @@ -29,6 +29,8 @@ namespace insight { class NullCollector : public Collector { public: + explicit NullCollector() = default; + static std::shared_ptr New (); }; diff --git a/src/ripple/beast/insight/StatsDCollector.h b/src/ripple/beast/insight/StatsDCollector.h index 8a97f4558..b96731af5 100644 --- a/src/ripple/beast/insight/StatsDCollector.h +++ b/src/ripple/beast/insight/StatsDCollector.h @@ -35,6 +35,8 @@ namespace insight { class StatsDCollector : public Collector { public: + explicit StatsDCollector() = default; + /** Create a StatsD collector. @param address The IP address and port of the StatsD server. @param prefix A string pre-pended before each metric name. diff --git a/src/ripple/beast/insight/impl/NullCollector.cpp b/src/ripple/beast/insight/impl/NullCollector.cpp index 45f4d0fac..631e5f94a 100644 --- a/src/ripple/beast/insight/impl/NullCollector.cpp +++ b/src/ripple/beast/insight/impl/NullCollector.cpp @@ -26,6 +26,9 @@ namespace detail { class NullHookImpl : public HookImpl { +public: + explicit NullHookImpl() = default; + private: NullHookImpl& operator= (NullHookImpl const&); }; @@ -35,6 +38,8 @@ private: class NullCounterImpl : public CounterImpl { public: + explicit NullCounterImpl() = default; + void increment (value_type) { } @@ -48,6 +53,8 @@ private: class NullEventImpl : public EventImpl { public: + explicit NullEventImpl() = default; + void notify (value_type const&) { } @@ -61,6 +68,8 @@ private: class NullGaugeImpl : public GaugeImpl { public: + explicit NullGaugeImpl() = default; + void set (value_type) { } @@ -78,6 +87,8 @@ private: class NullMeterImpl : public MeterImpl { public: + explicit NullMeterImpl() = default; + void increment (value_type) { } diff --git a/src/ripple/beast/net/IPAddress.h b/src/ripple/beast/net/IPAddress.h index a2de956f4..8381f1423 100644 --- a/src/ripple/beast/net/IPAddress.h +++ b/src/ripple/beast/net/IPAddress.h @@ -335,6 +335,8 @@ namespace std { template <> struct hash { + explicit hash() = default; + std::size_t operator() (beast::IP::Address const& addr) const { @@ -347,6 +349,8 @@ namespace boost { template <> struct hash { + explicit hash() = default; + std::size_t operator() (beast::IP::Address const& addr) const { diff --git a/src/ripple/beast/net/IPAddressConversion.h b/src/ripple/beast/net/IPAddressConversion.h index db5a73df6..2b4763f71 100644 --- a/src/ripple/beast/net/IPAddressConversion.h +++ b/src/ripple/beast/net/IPAddressConversion.h @@ -53,6 +53,8 @@ namespace beast { // DEPRECATED struct IPAddressConversion { + explicit IPAddressConversion() = default; + static IP::Endpoint from_asio (boost::asio::ip::address const& address) { return IP::from_asio (address); } static IP::Endpoint from_asio (boost::asio::ip::tcp::endpoint const& endpoint) diff --git a/src/ripple/beast/net/IPAddressV4.h b/src/ripple/beast/net/IPAddressV4.h index 793b99077..2e5532ac3 100644 --- a/src/ripple/beast/net/IPAddressV4.h +++ b/src/ripple/beast/net/IPAddressV4.h @@ -182,6 +182,7 @@ template struct is_contiguously_hashable : public std::integral_constant { + explicit is_contiguously_hashable() = default; }; } @@ -193,6 +194,8 @@ namespace std { template <> struct hash { + explicit hash() = default; + std::size_t operator() (beast::IP::AddressV4 const& addr) const { return addr.value; } }; diff --git a/src/ripple/beast/net/IPAddressV6.h b/src/ripple/beast/net/IPAddressV6.h index 98d3377fd..c655d1088 100644 --- a/src/ripple/beast/net/IPAddressV6.h +++ b/src/ripple/beast/net/IPAddressV6.h @@ -33,6 +33,8 @@ namespace IP { /** Represents a version 4 IP address. */ struct AddressV6 { + explicit AddressV6() = default; + // VFALCO TODO /** Arithmetic comparison. */ @@ -100,6 +102,8 @@ namespace std { template <> struct hash { + explicit hash() = default; + std::size_t operator() (beast::IP::AddressV6 const& addr) const { assert(false); return 0; } }; diff --git a/src/ripple/beast/net/IPEndpoint.h b/src/ripple/beast/net/IPEndpoint.h index 5557a9028..7608b4859 100644 --- a/src/ripple/beast/net/IPEndpoint.h +++ b/src/ripple/beast/net/IPEndpoint.h @@ -157,6 +157,8 @@ namespace std { template <> struct hash { + explicit hash() = default; + std::size_t operator() (beast::IP::Endpoint const& endpoint) const { return beast::uhash<>{} (endpoint); } }; @@ -167,6 +169,8 @@ namespace boost { template <> struct hash { + explicit hash() = default; + std::size_t operator() (beast::IP::Endpoint const& endpoint) const { return beast::uhash<>{} (endpoint); } }; diff --git a/src/ripple/beast/rfc2616.h b/src/ripple/beast/rfc2616.h index 73d689acd..fc25b8187 100644 --- a/src/ripple/beast/rfc2616.h +++ b/src/ripple/beast/rfc2616.h @@ -46,6 +46,8 @@ namespace detail { struct ci_equal_pred { + explicit ci_equal_pred() = default; + bool operator()(char c1, char c2) { // VFALCO TODO Use a table lookup here diff --git a/src/ripple/beast/utility/Zero.h b/src/ripple/beast/utility/Zero.h index d9feeffe1..57f8c92c2 100644 --- a/src/ripple/beast/utility/Zero.h +++ b/src/ripple/beast/utility/Zero.h @@ -46,6 +46,7 @@ namespace beast { struct Zero { + explicit Zero() = default; }; namespace { diff --git a/src/ripple/beast/utility/maybe_const.h b/src/ripple/beast/utility/maybe_const.h index 1de13373c..9cddbf417 100644 --- a/src/ripple/beast/utility/maybe_const.h +++ b/src/ripple/beast/utility/maybe_const.h @@ -28,6 +28,7 @@ namespace beast { template struct maybe_const { + explicit maybe_const() = default; using type = typename std::conditional ::type const, typename std::remove_const ::type>::type; diff --git a/src/ripple/beast/utility/weak_fn.h b/src/ripple/beast/utility/weak_fn.h index d52bf92f1..04e682d44 100644 --- a/src/ripple/beast/utility/weak_fn.h +++ b/src/ripple/beast/utility/weak_fn.h @@ -43,6 +43,8 @@ namespace beast { template struct throw_if_invalid { + explicit throw_if_invalid() = default; + V operator()() const { throw std::bad_weak_ptr(); @@ -74,6 +76,8 @@ private: template struct ignore_if_invalid { + explicit ignore_if_invalid() = default; + V operator()() const { return V(); diff --git a/src/ripple/conditions/impl/error.cpp b/src/ripple/conditions/impl/error.cpp index 668c52244..647215989 100644 --- a/src/ripple/conditions/impl/error.cpp +++ b/src/ripple/conditions/impl/error.cpp @@ -30,6 +30,8 @@ class cryptoconditions_error_category : public std::error_category { public: + explicit cryptoconditions_error_category() = default; + const char* name() const noexcept override { diff --git a/src/ripple/conditions/impl/error.h b/src/ripple/conditions/impl/error.h index e30c14a77..de0a0fec2 100644 --- a/src/ripple/conditions/impl/error.h +++ b/src/ripple/conditions/impl/error.h @@ -59,6 +59,8 @@ namespace std template<> struct is_error_code_enum { + explicit is_error_code_enum() = default; + static bool const value = true; }; diff --git a/src/ripple/conditions/impl/utils.h b/src/ripple/conditions/impl/utils.h index 20b976ffa..030667aa1 100644 --- a/src/ripple/conditions/impl/utils.h +++ b/src/ripple/conditions/impl/utils.h @@ -45,6 +45,7 @@ namespace der { // length octets: struct Preamble { + explicit Preamble() = default; std::uint8_t type = 0; std::size_t tag = 0; std::size_t length = 0; diff --git a/src/ripple/consensus/ConsensusParms.h b/src/ripple/consensus/ConsensusParms.h index 569c6547e..e82577d01 100644 --- a/src/ripple/consensus/ConsensusParms.h +++ b/src/ripple/consensus/ConsensusParms.h @@ -34,6 +34,7 @@ using namespace std::chrono_literals; */ struct ConsensusParms { + explicit ConsensusParms() = default; //------------------------------------------------------------------------- // Validation and proposal durations are relative to NetClock times, so use diff --git a/src/ripple/consensus/ConsensusTypes.h b/src/ripple/consensus/ConsensusTypes.h index 04ddb25a7..05d03c8a9 100644 --- a/src/ripple/consensus/ConsensusTypes.h +++ b/src/ripple/consensus/ConsensusTypes.h @@ -173,6 +173,8 @@ public: */ struct ConsensusCloseTimes { + explicit ConsensusCloseTimes() = default; + //! Close time estimates, keep ordered for predictable traverse std::map peers; diff --git a/src/ripple/consensus/Validations.h b/src/ripple/consensus/Validations.h index bf2dd4bdf..0732e82c3 100644 --- a/src/ripple/consensus/Validations.h +++ b/src/ripple/consensus/Validations.h @@ -41,6 +41,8 @@ namespace ripple { */ struct ValidationParms { + explicit ValidationParms() = default; + /** The number of seconds a validation remains current after its ledger's close time. diff --git a/src/ripple/core/ConfigSections.h b/src/ripple/core/ConfigSections.h index fb3953043..f0817f527 100644 --- a/src/ripple/core/ConfigSections.h +++ b/src/ripple/core/ConfigSections.h @@ -27,6 +27,8 @@ namespace ripple { // VFALCO DEPRECATED in favor of the BasicConfig interface struct ConfigSection { + explicit ConfigSection() = default; + static std::string nodeDatabase () { return "node_db"; } static std::string shardDatabase () { return "shard_db"; } static std::string importNodeDatabase () { return "import_db"; } diff --git a/src/ripple/core/DatabaseCon.h b/src/ripple/core/DatabaseCon.h index b19478433..7753879e2 100644 --- a/src/ripple/core/DatabaseCon.h +++ b/src/ripple/core/DatabaseCon.h @@ -79,6 +79,8 @@ class DatabaseCon public: struct Setup { + explicit Setup() = default; + Config::StartUpType startUp = Config::NORMAL; bool standAlone = false; boost::filesystem::path dataDir; diff --git a/src/ripple/core/JobQueue.h b/src/ripple/core/JobQueue.h index 303a5542b..771117cbb 100644 --- a/src/ripple/core/JobQueue.h +++ b/src/ripple/core/JobQueue.h @@ -32,7 +32,10 @@ namespace ripple { class Logs; -struct Coro_create_t {}; +struct Coro_create_t +{ + explicit Coro_create_t() = default; +}; /** A pool of threads to perform work. diff --git a/src/ripple/core/impl/Workers.h b/src/ripple/core/impl/Workers.h index 6730e4cd5..d0495f3dc 100644 --- a/src/ripple/core/impl/Workers.h +++ b/src/ripple/core/impl/Workers.h @@ -108,7 +108,10 @@ public: //-------------------------------------------------------------------------- private: - struct PausedTag { }; + struct PausedTag + { + explicit PausedTag() = default; + }; /* A Worker executes tasks on its provided thread. diff --git a/src/ripple/json/impl/Writer.cpp b/src/ripple/json/impl/Writer.cpp index d6064ed29..4d232dc6e 100644 --- a/src/ripple/json/impl/Writer.cpp +++ b/src/ripple/json/impl/Writer.cpp @@ -189,6 +189,8 @@ private: // JSON collections are either arrrays, or objects. struct Collection { + explicit Collection() = default; + /** What type of collection are we in? */ Writer::CollectionType type; diff --git a/src/ripple/json/impl/json_batchallocator.h b/src/ripple/json/impl/json_batchallocator.h index 8d8b6c1cb..da768ab92 100644 --- a/src/ripple/json/impl/json_batchallocator.h +++ b/src/ripple/json/impl/json_batchallocator.h @@ -106,6 +106,8 @@ public: private: struct BatchInfo { + explicit BatchInfo() = default; + BatchInfo* next_; AllocatedType* used_; AllocatedType* end_; diff --git a/src/ripple/json/json_reader.h b/src/ripple/json/json_reader.h index 4129b5f55..800f110e9 100644 --- a/src/ripple/json/json_reader.h +++ b/src/ripple/json/json_reader.h @@ -106,6 +106,8 @@ private: class Token { public: + explicit Token() = default; + TokenType type_; Location start_; Location end_; @@ -114,6 +116,8 @@ private: class ErrorInfo { public: + explicit ErrorInfo() = default; + Token token_; std::string message_; Location extra_; diff --git a/src/ripple/ledger/OpenView.h b/src/ripple/ledger/OpenView.h index 920365349..bda42e0fe 100644 --- a/src/ripple/ledger/OpenView.h +++ b/src/ripple/ledger/OpenView.h @@ -36,7 +36,11 @@ namespace ripple { rules of open ledgers applied during transaction processing. */ -struct open_ledger_t {}; +struct open_ledger_t +{ + explicit open_ledger_t() = default; +}; + extern open_ledger_t const open_ledger; //------------------------------------------------------------------------------ diff --git a/src/ripple/ledger/PaymentSandbox.h b/src/ripple/ledger/PaymentSandbox.h index 979d6accd..0c0bbb0e3 100644 --- a/src/ripple/ledger/PaymentSandbox.h +++ b/src/ripple/ledger/PaymentSandbox.h @@ -74,6 +74,8 @@ private: AccountID, AccountID, Currency>; struct Value { + explicit Value() = default; + STAmount lowAcctCredits; STAmount highAcctCredits; STAmount lowAcctOrigBalance; diff --git a/src/ripple/ledger/ReadView.h b/src/ripple/ledger/ReadView.h index fc056642a..0a1ac517b 100644 --- a/src/ripple/ledger/ReadView.h +++ b/src/ripple/ledger/ReadView.h @@ -50,7 +50,7 @@ struct Fees std::uint32_t reserve = 0; // Reserve base (drops) std::uint32_t increment = 0; // Reserve increment (drops) - Fees() = default; + explicit Fees() = default; Fees (Fees const&) = default; Fees& operator= (Fees const&) = default; @@ -71,6 +71,8 @@ struct Fees /** Information about the notional ledger backing the view. */ struct LedgerInfo { + explicit LedgerInfo() = default; + // // For all ledgers // diff --git a/src/ripple/ledger/TxMeta.h b/src/ripple/ledger/TxMeta.h index 591f85f85..2e7fec586 100644 --- a/src/ripple/ledger/TxMeta.h +++ b/src/ripple/ledger/TxMeta.h @@ -37,7 +37,10 @@ public: using ref = const pointer&; private: - struct CtorHelper{}; + struct CtorHelper + { + explicit CtorHelper() = default; + }; template TxMeta (uint256 const& txID, std::uint32_t ledger, T const& data, beast::Journal j, CtorHelper); diff --git a/src/ripple/ledger/impl/CashDiff.cpp b/src/ripple/ledger/impl/CashDiff.cpp index eb8e4aa92..5a0733a79 100644 --- a/src/ripple/ledger/impl/CashDiff.cpp +++ b/src/ripple/ledger/impl/CashDiff.cpp @@ -31,6 +31,8 @@ namespace detail { // Data structure that summarize cash changes in a single ApplyStateTable. struct CashSummary { + explicit CashSummary() = default; + // Sorted vectors. All of the vectors fill in for std::maps. std::vector> xrpChanges; diff --git a/src/ripple/net/HTTPClient.h b/src/ripple/net/HTTPClient.h index 2d602b0de..85fee29c3 100644 --- a/src/ripple/net/HTTPClient.h +++ b/src/ripple/net/HTTPClient.h @@ -32,6 +32,8 @@ namespace ripple { class HTTPClient { public: + explicit HTTPClient() = default; + enum { maxClientHeaderBytes = 32 * 1024 diff --git a/src/ripple/net/impl/RPCCall.cpp b/src/ripple/net/impl/RPCCall.cpp index 3ac739121..6c64fd0d4 100644 --- a/src/ripple/net/impl/RPCCall.cpp +++ b/src/ripple/net/impl/RPCCall.cpp @@ -1170,6 +1170,8 @@ namespace struct RPCCallImp { + explicit RPCCallImp() = default; + // VFALCO NOTE Is this a to-do comment or a doc comment? // Place the async result somewhere useful. static void callRPCHandler (Json::Value* jvOutput, Json::Value const& jvInput) diff --git a/src/ripple/nodestore/NodeObject.h b/src/ripple/nodestore/NodeObject.h index d7a511872..ef06d49a1 100644 --- a/src/ripple/nodestore/NodeObject.h +++ b/src/ripple/nodestore/NodeObject.h @@ -66,7 +66,10 @@ private: // This hack is used to make the constructor effectively private // except for when we use it in the call to make_shared. // There's no portable way to make make_shared<> a friend work. - struct PrivateAccess { }; + struct PrivateAccess + { + explicit PrivateAccess() = default; + }; public: // This constructor is private, use createObject instead. NodeObject (NodeObjectType type, diff --git a/src/ripple/nodestore/Scheduler.h b/src/ripple/nodestore/Scheduler.h index be6175fcf..cf7bd62d0 100644 --- a/src/ripple/nodestore/Scheduler.h +++ b/src/ripple/nodestore/Scheduler.h @@ -29,6 +29,8 @@ namespace NodeStore { /** Contains information about a fetch operation. */ struct FetchReport { + explicit FetchReport() = default; + std::chrono::milliseconds elapsed; bool isAsync; bool wentToDisk; @@ -38,6 +40,8 @@ struct FetchReport /** Contains information about a batch write operation. */ struct BatchWriteReport { + explicit BatchWriteReport() = default; + std::chrono::milliseconds elapsed; int writeCount; }; diff --git a/src/ripple/nodestore/backend/MemoryFactory.cpp b/src/ripple/nodestore/backend/MemoryFactory.cpp index 36d576fb6..e3d65f945 100644 --- a/src/ripple/nodestore/backend/MemoryFactory.cpp +++ b/src/ripple/nodestore/backend/MemoryFactory.cpp @@ -31,6 +31,8 @@ namespace NodeStore { struct MemoryDB { + explicit MemoryDB() = default; + std::mutex mutex; bool open = false; std::map > table; diff --git a/src/ripple/nodestore/impl/varint.h b/src/ripple/nodestore/impl/varint.h index dc8b68ecb..41e7bbddf 100644 --- a/src/ripple/nodestore/impl/varint.h +++ b/src/ripple/nodestore/impl/varint.h @@ -44,6 +44,8 @@ struct varint_traits; template struct varint_traits { + explicit varint_traits() = default; + static std::size_t constexpr max = (8 * sizeof(T) + 6) / 7; }; diff --git a/src/ripple/overlay/Cluster.h b/src/ripple/overlay/Cluster.h index bea1c35d6..41489c4e0 100644 --- a/src/ripple/overlay/Cluster.h +++ b/src/ripple/overlay/Cluster.h @@ -41,6 +41,8 @@ class Cluster private: struct Comparator { + explicit Comparator() = default; + using is_transparent = std::true_type; bool diff --git a/src/ripple/overlay/Overlay.h b/src/ripple/overlay/Overlay.h index 75cfdf971..305fb0fb8 100644 --- a/src/ripple/overlay/Overlay.h +++ b/src/ripple/overlay/Overlay.h @@ -64,6 +64,8 @@ public: struct Setup { + explicit Setup() = default; + std::shared_ptr context; bool expire = false; beast::IP::Address public_ip; diff --git a/src/ripple/peerfinder/impl/Bootcache.h b/src/ripple/peerfinder/impl/Bootcache.h index 319a76a7d..336023ef9 100644 --- a/src/ripple/peerfinder/impl/Bootcache.h +++ b/src/ripple/peerfinder/impl/Bootcache.h @@ -88,6 +88,8 @@ private: map_type::right_map::const_iterator::value_type const&, beast::IP::Endpoint const&> { + explicit Transform() = default; + beast::IP::Endpoint const& operator() ( map_type::right_map:: const_iterator::value_type const& v) const diff --git a/src/ripple/peerfinder/impl/Livecache.h b/src/ripple/peerfinder/impl/Livecache.h index 8352b500f..cfcc040ed 100644 --- a/src/ripple/peerfinder/impl/Livecache.h +++ b/src/ripple/peerfinder/impl/Livecache.h @@ -39,6 +39,8 @@ namespace detail { class LivecacheBase { +public: + explicit LivecacheBase() = default; protected: struct Element : boost::intrusive::list_base_hook <> @@ -68,6 +70,8 @@ public: struct Transform : public std::unary_function { + explicit Transform() = default; + Endpoint const& operator() (Element const& e) const { return e.endpoint; @@ -223,6 +227,8 @@ public: : public std::unary_function < typename lists_type::value_type, Hop > { + explicit Transform() = default; + Hop operator() (typename beast::maybe_const < IsConst, typename lists_type::value_type>::type& list) const { diff --git a/src/ripple/peerfinder/impl/Reporting.h b/src/ripple/peerfinder/impl/Reporting.h index 5efb8bc4a..0d0df57bc 100644 --- a/src/ripple/peerfinder/impl/Reporting.h +++ b/src/ripple/peerfinder/impl/Reporting.h @@ -28,6 +28,8 @@ namespace PeerFinder { */ struct Reporting { + explicit Reporting() = default; + // Report simulation parameters static bool const params = true; diff --git a/src/ripple/peerfinder/impl/Source.h b/src/ripple/peerfinder/impl/Source.h index 6c0f4fe27..53c42062f 100644 --- a/src/ripple/peerfinder/impl/Source.h +++ b/src/ripple/peerfinder/impl/Source.h @@ -41,6 +41,8 @@ public: /** The results of a fetch. */ struct Results { + explicit Results() = default; + // error_code on a failure boost::system::error_code error; diff --git a/src/ripple/peerfinder/impl/SourceStrings.h b/src/ripple/peerfinder/impl/SourceStrings.h index 3e79f3ac8..9ae9bc217 100644 --- a/src/ripple/peerfinder/impl/SourceStrings.h +++ b/src/ripple/peerfinder/impl/SourceStrings.h @@ -30,6 +30,8 @@ namespace PeerFinder { class SourceStrings : public Source { public: + explicit SourceStrings() = default; + using Strings = std::vector ; static beast::SharedPtr New (std::string const& name, Strings const& strings); diff --git a/src/ripple/peerfinder/impl/Store.h b/src/ripple/peerfinder/impl/Store.h index 7e9539513..b12f5735d 100644 --- a/src/ripple/peerfinder/impl/Store.h +++ b/src/ripple/peerfinder/impl/Store.h @@ -36,6 +36,8 @@ public: // save the bootstrap cache struct Entry { + explicit Entry() = default; + beast::IP::Endpoint endpoint; int valence; }; diff --git a/src/ripple/peerfinder/sim/FunctionQueue.h b/src/ripple/peerfinder/sim/FunctionQueue.h index 5a55bba0e..4fb820cb6 100644 --- a/src/ripple/peerfinder/sim/FunctionQueue.h +++ b/src/ripple/peerfinder/sim/FunctionQueue.h @@ -27,6 +27,9 @@ namespace Sim { /** Maintains a queue of functors that can be called later. */ class FunctionQueue { +public: + explicit FunctionQueue() = default; + private: class BasicWork { diff --git a/src/ripple/peerfinder/sim/NodeSnapshot.h b/src/ripple/peerfinder/sim/NodeSnapshot.h index 6dfc610e8..24485ffc5 100644 --- a/src/ripple/peerfinder/sim/NodeSnapshot.h +++ b/src/ripple/peerfinder/sim/NodeSnapshot.h @@ -27,7 +27,7 @@ namespace Sim { /** A snapshot of a Node in the network simulator. */ struct NodeSnapshot { - + explicit NodeSnapshot() = default; }; } diff --git a/src/ripple/protocol/AccountID.h b/src/ripple/protocol/AccountID.h index 7736967bb..b50166409 100644 --- a/src/ripple/protocol/AccountID.h +++ b/src/ripple/protocol/AccountID.h @@ -35,7 +35,11 @@ namespace ripple { namespace detail { -class AccountIDTag { }; +class AccountIDTag +{ +public: + explicit AccountIDTag() = default; +}; } // detail @@ -183,6 +187,7 @@ namespace std { template <> struct hash : ripple::AccountID::hasher { + explicit hash() = default; }; } // std diff --git a/src/ripple/protocol/Book.h b/src/ripple/protocol/Book.h index 5620ebda9..445691299 100644 --- a/src/ripple/protocol/Book.h +++ b/src/ripple/protocol/Book.h @@ -108,6 +108,8 @@ private: std::hash , 1>; public: + explicit hash() = default; + using value_type = std::size_t; using argument_type = ripple::Issue; @@ -132,6 +134,8 @@ private: hasher m_hasher; public: + explicit hash() = default; + using value_type = std::size_t; using argument_type = ripple::Book; @@ -153,6 +157,8 @@ template <> struct hash : std::hash { + explicit hash() = default; + using Base = std::hash ; // VFALCO NOTE broken in vs2012 //using Base::Base; // inherit ctors @@ -162,6 +168,8 @@ template <> struct hash : std::hash { + explicit hash() = default; + using Base = std::hash ; // VFALCO NOTE broken in vs2012 //using Base::Base; // inherit ctors diff --git a/src/ripple/protocol/Indexes.h b/src/ripple/protocol/Indexes.h index 23252445b..95ced1dc5 100644 --- a/src/ripple/protocol/Indexes.h +++ b/src/ripple/protocol/Indexes.h @@ -109,6 +109,8 @@ namespace keylet { /** AccountID root */ struct account_t { + explicit account_t() = default; + Keylet operator()(AccountID const& id) const; }; static account_t const account {}; @@ -116,6 +118,8 @@ static account_t const account {}; /** The amendment table */ struct amendments_t { + explicit amendments_t() = default; + Keylet operator()() const; }; static amendments_t const amendments {}; @@ -126,6 +130,8 @@ Keylet child (uint256 const& key); /** Skip list */ struct skip_t { + explicit skip_t() = default; + Keylet operator()() const; Keylet operator()(LedgerIndex ledger) const; @@ -135,6 +141,8 @@ static skip_t const skip {}; /** The ledger fees */ struct fees_t { + explicit fees_t() = default; + // VFALCO This could maybe be constexpr Keylet operator()() const; }; @@ -143,6 +151,8 @@ static fees_t const fees {}; /** The beginning of an order book */ struct book_t { + explicit book_t() = default; + Keylet operator()(Book const& b) const; }; static book_t const book {}; @@ -150,6 +160,8 @@ static book_t const book {}; /** A trust line */ struct line_t { + explicit line_t() = default; + Keylet operator()(AccountID const& id0, AccountID const& id1, Currency const& currency) const; @@ -166,6 +178,8 @@ static line_t const line {}; /** An offer from an account */ struct offer_t { + explicit offer_t() = default; + Keylet operator()(AccountID const& id, std::uint32_t seq) const; @@ -179,6 +193,8 @@ static offer_t const offer {}; /** The initial directory page for a specific quality */ struct quality_t { + explicit quality_t() = default; + Keylet operator()(Keylet const& k, std::uint64_t q) const; }; @@ -187,6 +203,8 @@ static quality_t const quality {}; /** The directry for the next lower quality */ struct next_t { + explicit next_t() = default; + Keylet operator()(Keylet const& k) const; }; static next_t const next {}; @@ -194,6 +212,8 @@ static next_t const next {}; /** A ticket belonging to an account */ struct ticket_t { + explicit ticket_t() = default; + Keylet operator()(AccountID const& id, std::uint32_t seq) const; @@ -207,6 +227,8 @@ static ticket_t const ticket {}; /** A SignerList */ struct signers_t { + explicit signers_t() = default; + Keylet operator()(AccountID const& id) const; Keylet operator()(uint256 const& key) const @@ -219,6 +241,8 @@ static signers_t const signers {}; /** A Check */ struct check_t { + explicit check_t() = default; + Keylet operator()(AccountID const& id, std::uint32_t seq) const; diff --git a/src/ripple/protocol/PublicKey.h b/src/ripple/protocol/PublicKey.h index fa963c4a7..1ca4fe951 100644 --- a/src/ripple/protocol/PublicKey.h +++ b/src/ripple/protocol/PublicKey.h @@ -141,6 +141,8 @@ hash_append (Hasher& h, template<> struct STExchange { + explicit STExchange() = default; + using value_type = PublicKey; static diff --git a/src/ripple/protocol/STAmount.h b/src/ripple/protocol/STAmount.h index 4330c0cac..19d9412b3 100644 --- a/src/ripple/protocol/STAmount.h +++ b/src/ripple/protocol/STAmount.h @@ -78,7 +78,10 @@ public: //-------------------------------------------------------------------------- STAmount(SerialIter& sit, SField const& name); - struct unchecked { }; + struct unchecked + { + explicit unchecked() = default; + }; // Do not call canonicalize STAmount (SField const& name, Issue const& issue, diff --git a/src/ripple/protocol/STExchange.h b/src/ripple/protocol/STExchange.h index ac322cc5e..802002472 100644 --- a/src/ripple/protocol/STExchange.h +++ b/src/ripple/protocol/STExchange.h @@ -44,6 +44,8 @@ struct STExchange; template struct STExchange, T> { + explicit STExchange() = default; + using value_type = U; static @@ -66,6 +68,8 @@ struct STExchange, T> template <> struct STExchange { + explicit STExchange() = default; + using value_type = Slice; static @@ -89,6 +93,8 @@ struct STExchange template <> struct STExchange { + explicit STExchange() = default; + using value_type = Buffer; static diff --git a/src/ripple/protocol/STObject.h b/src/ripple/protocol/STObject.h index a90641abd..3742507e1 100644 --- a/src/ripple/protocol/STObject.h +++ b/src/ripple/protocol/STObject.h @@ -251,6 +251,8 @@ private: struct Transform { + explicit Transform() = default; + using argument_type = detail::STVar; using result_type = STBase; diff --git a/src/ripple/protocol/TxFlags.h b/src/ripple/protocol/TxFlags.h index 575788e74..1c9d671f1 100644 --- a/src/ripple/protocol/TxFlags.h +++ b/src/ripple/protocol/TxFlags.h @@ -38,6 +38,8 @@ namespace ripple { class TxFlag { public: + explicit TxFlag() = default; + static std::uint32_t const requireDestTag = 0x00010000; }; // VFALCO TODO Move all flags into this container after some study. diff --git a/src/ripple/protocol/UintTypes.h b/src/ripple/protocol/UintTypes.h index ad66072c3..ccbe3f201 100644 --- a/src/ripple/protocol/UintTypes.h +++ b/src/ripple/protocol/UintTypes.h @@ -27,9 +27,23 @@ namespace ripple { namespace detail { -class CurrencyTag {}; -class DirectoryTag {}; -class NodeIDTag {}; +class CurrencyTag +{ +public: + explicit CurrencyTag() = default; +}; + +class DirectoryTag +{ +public: + explicit DirectoryTag() = default; +}; + +class NodeIDTag +{ +public: + explicit NodeIDTag() = default; +}; } // detail @@ -80,16 +94,19 @@ namespace std { template <> struct hash : ripple::Currency::hasher { + explicit hash() = default; }; template <> struct hash : ripple::NodeID::hasher { + explicit hash() = default; }; template <> struct hash : ripple::Directory::hasher { + explicit hash() = default; }; } // std diff --git a/src/ripple/protocol/impl/ErrorCodes.cpp b/src/ripple/protocol/impl/ErrorCodes.cpp index d0d1e154a..59bb7ae95 100644 --- a/src/ripple/protocol/impl/ErrorCodes.cpp +++ b/src/ripple/protocol/impl/ErrorCodes.cpp @@ -29,6 +29,8 @@ namespace std { template <> struct hash { + explicit hash() = default; + std::size_t operator() (ripple::error_code_i value) const { return value; diff --git a/src/ripple/protocol/impl/SField.cpp b/src/ripple/protocol/impl/SField.cpp index d9515b990..5ffa78456 100644 --- a/src/ripple/protocol/impl/SField.cpp +++ b/src/ripple/protocol/impl/SField.cpp @@ -46,6 +46,8 @@ using StaticScopedLockType = std::lock_guard ; // Give this translation unit only, permission to construct SFields struct SField::make { + explicit make() = default; + template static SField one(SField const* p, Args&& ...args) { diff --git a/src/ripple/protocol/impl/STVar.h b/src/ripple/protocol/impl/STVar.h index bae3de8f5..bf629c468 100644 --- a/src/ripple/protocol/impl/STVar.h +++ b/src/ripple/protocol/impl/STVar.h @@ -31,8 +31,15 @@ namespace ripple { namespace detail { -struct defaultObject_t { }; -struct nonPresentObject_t { }; +struct defaultObject_t +{ + explicit defaultObject_t() = default; +}; + +struct nonPresentObject_t +{ + explicit nonPresentObject_t() = default; +}; extern defaultObject_t defaultObject; extern nonPresentObject_t nonPresentObject; diff --git a/src/ripple/resource/Gossip.h b/src/ripple/resource/Gossip.h index 23e1aff9a..8947901ad 100644 --- a/src/ripple/resource/Gossip.h +++ b/src/ripple/resource/Gossip.h @@ -28,9 +28,13 @@ namespace Resource { /** Data format for exchanging consumption information across peers. */ struct Gossip { + explicit Gossip() = default; + /** Describes a single consumer. */ struct Item { + explicit Item() = default; + int balance; beast::IP::Endpoint address; }; diff --git a/src/ripple/resource/impl/Import.h b/src/ripple/resource/impl/Import.h index c25aa906f..ae5774da0 100644 --- a/src/ripple/resource/impl/Import.h +++ b/src/ripple/resource/impl/Import.h @@ -31,6 +31,8 @@ struct Import { struct Item { + explicit Item() = default; + int balance; Consumer consumer; }; diff --git a/src/ripple/resource/impl/Key.h b/src/ripple/resource/impl/Key.h index 21b1adf81..2d7d2a267 100644 --- a/src/ripple/resource/impl/Key.h +++ b/src/ripple/resource/impl/Key.h @@ -77,6 +77,8 @@ struct Key struct key_equal { + explicit key_equal() = default; + bool operator() (Key const& lhs, Key const& rhs) const { if (lhs.kind != rhs.kind) diff --git a/src/ripple/rpc/impl/ServerHandlerImp.h b/src/ripple/rpc/impl/ServerHandlerImp.h index cf83ce007..b36b762de 100644 --- a/src/ripple/rpc/impl/ServerHandlerImp.h +++ b/src/ripple/rpc/impl/ServerHandlerImp.h @@ -46,11 +46,15 @@ class ServerHandlerImp public: struct Setup { + explicit Setup() = default; + std::vector ports; // Memberspace struct client_t { + explicit client_t() = default; + bool secure = false; std::string ip; std::uint16_t port = 0; @@ -66,6 +70,8 @@ public: // Configuration for the Overlay struct overlay_t { + explicit overlay_t() = default; + boost::asio::ip::address ip; std::uint16_t port = 0; }; diff --git a/src/ripple/rpc/json_body.h b/src/ripple/rpc/json_body.h index 6dc1e8786..e115ca883 100644 --- a/src/ripple/rpc/json_body.h +++ b/src/ripple/rpc/json_body.h @@ -29,6 +29,8 @@ namespace ripple { /// Body that holds JSON struct json_body { + explicit json_body() = default; + using value_type = Json::Value; class reader diff --git a/src/ripple/server/Port.h b/src/ripple/server/Port.h index e911ebc7a..d15f3cd0c 100644 --- a/src/ripple/server/Port.h +++ b/src/ripple/server/Port.h @@ -37,6 +37,8 @@ namespace ripple { /** Configuration information for a Server listening port. */ struct Port { + explicit Port() = default; + std::string name; boost::asio::ip::address ip; std::uint16_t port = 0; @@ -78,6 +80,8 @@ operator<< (std::ostream& os, Port const& p); struct ParsedPort { + explicit ParsedPort() = default; + std::string name; std::set protocol; std::string user;