diff --git a/libraries/chain/include/eosio/chain/transaction_object.hpp b/libraries/chain/include/eosio/chain/transaction_object.hpp index d43b449be4..301988e33d 100644 --- a/libraries/chain/include/eosio/chain/transaction_object.hpp +++ b/libraries/chain/include/eosio/chain/transaction_object.hpp @@ -42,7 +42,6 @@ namespace eosio { namespace chain { > >; - typedef chainbase::generic_index transaction_index; } } CHAINBASE_SET_INDEX_TYPE(eosio::chain::transaction_object, eosio::chain::transaction_multi_index) diff --git a/libraries/libfc/include/fc/mutex.hpp b/libraries/libfc/include/fc/mutex.hpp index 518a9ccd8b..eaa1a13883 100644 --- a/libraries/libfc/include/fc/mutex.hpp +++ b/libraries/libfc/include/fc/mutex.hpp @@ -127,13 +127,13 @@ class SCOPED_CAPABILITY lock_guard { public: // Acquire mu, implicitly acquire *this and associate it with mu. - lock_guard(M& mu) ACQUIRE(mu) + [[nodiscard]] lock_guard(M& mu) ACQUIRE(mu) : mut(mu) { mu.lock(); } // Assume mu is held, implicitly acquire *this and associate it with mu. - lock_guard(M& mu, adopt_lock_t) REQUIRES(mu) + [[nodiscard]] lock_guard(M& mu, adopt_lock_t) REQUIRES(mu) : mut(mu) {} ~lock_guard() RELEASE() { mut.unlock(); } @@ -150,24 +150,24 @@ class SCOPED_CAPABILITY unique_lock { bool locked; public: - unique_lock() noexcept + [[nodiscard]] unique_lock() noexcept : mut(nullptr) , locked(false) {} // Acquire mu, implicitly acquire *this and associate it with mu. - explicit unique_lock(M& mu) ACQUIRE(mu) + [[nodiscard]] explicit unique_lock(M& mu) ACQUIRE(mu) : mut(&mu) , locked(true) { mut->lock(); } // Assume mu is held, implicitly acquire *this and associate it with mu. - unique_lock(M& mu, adopt_lock_t) REQUIRES(mu) + [[nodiscard]] unique_lock(M& mu, adopt_lock_t) REQUIRES(mu) : mut(&mu) , locked(true) {} // Assume mu is not held, implicitly acquire *this and associate it with mu. - unique_lock(M& mu, defer_lock_t) EXCLUDES(mu) + [[nodiscard]] unique_lock(M& mu, defer_lock_t) EXCLUDES(mu) : mut(mu) , locked(false) {} diff --git a/libraries/libfc/include/fc/scoped_exit.hpp b/libraries/libfc/include/fc/scoped_exit.hpp index 8cae626b87..657bfe6a08 100644 --- a/libraries/libfc/include/fc/scoped_exit.hpp +++ b/libraries/libfc/include/fc/scoped_exit.hpp @@ -8,9 +8,9 @@ namespace fc { class scoped_exit { public: template - scoped_exit( C&& c ):callback( std::forward(c) ){} + [[nodiscard]] scoped_exit( C&& c ):callback( std::forward(c) ){} - scoped_exit( scoped_exit&& mv ) + [[nodiscard]] scoped_exit( scoped_exit&& mv ) :callback( std::move( mv.callback ) ),canceled(mv.canceled) { mv.canceled = true;