From 2088d99716d20b141a1195c792fdc400ce31f81f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 16 Dec 2020 11:02:48 +0100 Subject: C++: Modernize special member functions --- sord/sordmm.hpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'sord/sordmm.hpp') 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 { Iter(const Iter&) = delete; Iter& operator=(const Iter&) = delete; - inline Iter(Iter&& iter) - : Wrapper(iter) + inline Iter(Iter&& iter) noexcept + : Wrapper(iter) , _world(iter._world) {} -- cgit v1.2.1