diff --git a/src/config.h b/src/config.h --- a/src/config.h +++ b/src/config.h @@ -8,15 +8,13 @@ #include #include -#include - #include #include #include class CChainParams; -class Config : public boost::noncopyable { +class Config { public: virtual bool SetMaxBlockSize(uint64_t maxBlockSize) = 0; virtual uint64_t GetMaxBlockSize() const = 0; @@ -26,6 +24,10 @@ virtual void SetExcessUTXOCharge(Amount amt) = 0; virtual Amount GetExcessUTXOCharge() const = 0; + + Config() = default; + Config(const Config &) = delete; + Config &operator=(const Config &) = delete; }; class GlobalConfig final : public Config { diff --git a/src/radix.h b/src/radix.h --- a/src/radix.h +++ b/src/radix.h @@ -8,8 +8,6 @@ #include #include -#include - #include #include #include @@ -38,7 +36,7 @@ * itself cannot be destroyed and will leak memory instead of cleaning up after * itself. This obviously needs to be fixed in subsequent revisions. */ -template struct RadixTree : public boost::noncopyable { +template struct RadixTree { private: static const int BITS = 4; static const int MASK = (1 << BITS) - 1; @@ -58,6 +56,9 @@ RadixTree() : root(RadixElement()) {} ~RadixTree() { root.load().release(); } + RadixTree(const RadixTree &) = delete; + RadixTree &operator=(const RadixTree &) = delete; + /** * Insert a value into the tree. * Returns true if the value was inserted, false if it was already present. @@ -249,7 +250,7 @@ } }; - struct RadixNode : public boost::noncopyable { + struct RadixNode { IMPLEMENT_RCU_REFCOUNT(uint64_t); private: @@ -271,6 +272,9 @@ } } + RadixNode(const RadixNode &) = delete; + RadixNode &operator=(const RadixNode &) = delete; + std::atomic *get(uint32_t level, const K &key) { return &children[(key >> (level * BITS)) & MASK]; } diff --git a/src/rcu.h b/src/rcu.h --- a/src/rcu.h +++ b/src/rcu.h @@ -5,8 +5,6 @@ #ifndef BITCOIN_RCU_H #define BITCOIN_RCU_H -#include - #include #include #include @@ -57,7 +55,7 @@ static thread_local RCUInfos infos; }; -class RCULock : public boost::noncopyable { +class RCULock { RCUInfos *infos; explicit RCULock(RCUInfos *infosIn) : infos(infosIn) { infos->readLock(); } @@ -67,6 +65,9 @@ RCULock() : RCULock(&RCUInfos::infos) {} ~RCULock() { infos->readFree(); } + RCULock(const RCULock &) = delete; + RCULock &operator=(const RCULock &) = delete; + static bool isLocked() { return RCUInfos::infos.isLocked(); } static void registerCleanup(const std::function &f) { RCUInfos::infos.registerCleanup(f); diff --git a/src/rpc/command.h b/src/rpc/command.h --- a/src/rpc/command.h +++ b/src/rpc/command.h @@ -7,8 +7,6 @@ #include -#include - #include class JSONRPCRequest; @@ -19,7 +17,7 @@ * necessary. For more typical cases where only request arguments are * required, see the RPCCommandWithArgsContext class. */ -class RPCCommand : public boost::noncopyable { +class RPCCommand { private: const std::string name; @@ -36,6 +34,9 @@ RPCCommand(const std::string &nameIn) : name(nameIn) {} virtual ~RPCCommand() {} + RPCCommand(const RPCCommand &) = delete; + RPCCommand &operator=(const RPCCommand &) = delete; + /** * It is recommended to override Execute(JSONRPCRequest) only if the entire * request context is required. Otherwise, use RPCCommandWithArgsContext diff --git a/src/rpc/server.h b/src/rpc/server.h --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -15,8 +15,6 @@ #include -#include - #include #include #include @@ -38,13 +36,16 @@ /** * Class for registering and managing all RPC calls. */ -class RPCServer : public boost::noncopyable { +class RPCServer { private: RWCollection commands; public: RPCServer() {} + RPCServer(const RPCServer &) = delete; + RPCServer &operator=(const RPCServer &) = delete; + /** * Attempts to execute an RPC command from the given request. * If no RPC command exists that matches the request, an error is returned. diff --git a/src/rwcollection.h b/src/rwcollection.h --- a/src/rwcollection.h +++ b/src/rwcollection.h @@ -7,7 +7,6 @@ #include -#include #include #include #include @@ -16,7 +15,7 @@ #include #include -template class RWCollectionView : boost::noncopyable { +template class RWCollectionView { private: L lock; T *collection; @@ -30,6 +29,9 @@ RWCollectionView(RWCollectionView &&other) : lock(std::move(other.lock)), collection(other.collection) {} + RWCollectionView(const RWCollectionView &) = delete; + const RWCollectionView &operator=(const RWCollectionView) = delete; + T *operator->() { return collection; } const T *operator->() const { return collection; } diff --git a/test/lint/lint-boost-dependencies.sh b/test/lint/lint-boost-dependencies.sh --- a/test/lint/lint-boost-dependencies.sh +++ b/test/lint/lint-boost-dependencies.sh @@ -22,7 +22,6 @@ boost/multi_index/ordered_index.hpp boost/multi_index/sequenced_index.hpp boost/multi_index_container.hpp - boost/noncopyable.hpp boost/preprocessor/cat.hpp boost/preprocessor/stringize.hpp boost/range/iterator.hpp