From 53465e329a25aa8f8e6e380f6b93e4e104373844 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 6 Sep 2015 13:45:05 -0400 Subject: [PATCH] Common: Alter semantics of the NonCopyable mixin Uses delete to make the unimplemented functions detectable at compile time and not link time if they are used. The move constructor and assignment operator are removed as moves are not copies, but transfers of ownership, which isn't suited for this class. --- Source/Core/Common/Common.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/Common/Common.h b/Source/Core/Common/Common.h index 8027e31878..492c35d0be 100644 --- a/Source/Core/Common/Common.h +++ b/Source/Core/Common/Common.h @@ -60,12 +60,12 @@ extern const char *netplay_dolphin_ver; class NonCopyable { protected: - NonCopyable() {} - NonCopyable(const NonCopyable&&) {} - void operator=(const NonCopyable&&) {} + constexpr NonCopyable() = default; + ~NonCopyable() = default; + private: - NonCopyable(NonCopyable&); - NonCopyable& operator=(NonCopyable& other); + NonCopyable(NonCopyable&) = delete; + NonCopyable& operator=(NonCopyable&) = delete; }; #if defined _WIN32