From 4d6d4a97e4df55ae1f1ec2cb6b7961efd6d35c89 Mon Sep 17 00:00:00 2001 From: comex Date: Fri, 30 Aug 2013 00:00:06 -0400 Subject: [PATCH] Make NonCopyable use rvalue references. This is required to be able to move objects that inherit from it. (Note that this patch also #ifs out the class for the externals that include it yet are compiled in pre-C++11 mode. It shouldn't matter, since those externals don't use it.) --- Source/Core/Common/Src/Common.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h index 9a1ebab8e9..eb0679d358 100644 --- a/Source/Core/Common/Src/Common.h +++ b/Source/Core/Common/Src/Common.h @@ -25,15 +25,20 @@ extern const char *netplay_dolphin_ver; #define STACKALIGN +#if __cplusplus >= 201103 || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) +#define HAVE_CXX11_SYNTAX 1 +#endif + +#if HAVE_CXX11_SYNTAX // An inheritable class to disallow the copy constructor and operator= functions class NonCopyable { protected: NonCopyable() {} -private: - NonCopyable(const NonCopyable&); - void operator=(const NonCopyable&); + NonCopyable(const NonCopyable&&) {} + void operator=(const NonCopyable&&) {} }; +#endif #include "Log.h" #include "CommonTypes.h"