mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 05:34:57 +01:00
Refactor: Modernize disallowed copy constructors/assignment
Use C++11's better capability of expressing an interface of a non-copyable class by publicly deleting its copy ctor and assignment operator instead of just declaring them private.
This commit is contained in:
10
src/coins.h
10
src/coins.h
@@ -214,6 +214,11 @@ protected:
|
||||
public:
|
||||
CCoinsViewCache(CCoinsView *baseIn);
|
||||
|
||||
/**
|
||||
* By deleting the copy constructor, we prevent accidentally using it when one intends to create a cache on top of a base cache.
|
||||
*/
|
||||
CCoinsViewCache(const CCoinsViewCache &) = delete;
|
||||
|
||||
// Standard CCoinsView methods
|
||||
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;
|
||||
bool HaveCoin(const COutPoint &outpoint) const override;
|
||||
@@ -290,11 +295,6 @@ public:
|
||||
|
||||
private:
|
||||
CCoinsMap::iterator FetchCoin(const COutPoint &outpoint) const;
|
||||
|
||||
/**
|
||||
* By making the copy constructor private, we prevent accidentally using it when one intends to create a cache on top of a base cache.
|
||||
*/
|
||||
CCoinsViewCache(const CCoinsViewCache &);
|
||||
};
|
||||
|
||||
//! Utility function to add all of a transaction's outputs to a cache.
|
||||
|
||||
Reference in New Issue
Block a user