diff options
author | David Robillard <d@drobilla.net> | 2020-12-16 11:02:48 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-16 11:06:32 +0100 |
commit | 2088d99716d20b141a1195c792fdc400ce31f81f (patch) | |
tree | 0c260a339cf6eb9509588afa04fda56100142b00 | |
parent | 86da10ac94f64d16ad145200664fc8532fd90783 (diff) | |
download | sord-2088d99716d20b141a1195c792fdc400ce31f81f.tar.gz sord-2088d99716d20b141a1195c792fdc400ce31f81f.tar.bz2 sord-2088d99716d20b141a1195c792fdc400ce31f81f.zip |
C++: Modernize special member functions
-rw-r--r-- | sord/sordmm.hpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sord/sordmm.hpp b/sord/sordmm.hpp index c6bea7b..50944a5 100644 --- a/sord/sordmm.hpp +++ b/sord/sordmm.hpp @@ -48,14 +48,17 @@ namespace Sord { -/** Utility base class to prevent copying. */ +/** Utility base class to prevent copying or moving. */ class Noncopyable { -protected: - Noncopyable() {} - ~Noncopyable() {} -private: - Noncopyable(const Noncopyable&); - const Noncopyable& operator=(const Noncopyable&); +public: + Noncopyable() = default; + ~Noncopyable() = default; + + Noncopyable(const Noncopyable&) = delete; + const Noncopyable& operator=(const Noncopyable&) = delete; + + Noncopyable(Noncopyable&&) = delete; + Noncopyable& operator=(Noncopyable&&) = delete; }; /** C++ wrapper for a Sord object. */ @@ -429,8 +432,8 @@ struct Iter : public Wrapper<SordIter*> { Iter(const Iter&) = delete; Iter& operator=(const Iter&) = delete; - inline Iter(Iter&& iter) - : Wrapper<SordIter*>(iter) + inline Iter(Iter&& iter) noexcept + : Wrapper<SordIter>(iter) , _world(iter._world) {} |