From 7a4b717772daf91819170caf32a71baa845c46ea Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 01:56:18 -0300 Subject: Common: Use C++11 deleted functions for NonCopyable --- src/common/common.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/common/common.h b/src/common/common.h index d11e57b1e..d64635620 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -14,15 +14,13 @@ #define STACKALIGN // An inheritable class to disallow the copy constructor and operator= functions -class NonCopyable -{ +class NonCopyable { protected: - NonCopyable() {} - NonCopyable(const NonCopyable&&) {} - void operator=(const NonCopyable&&) {} -private: - NonCopyable(NonCopyable&); - NonCopyable& operator=(NonCopyable& other); + NonCopyable() = default; + ~NonCopyable() = default; + + NonCopyable(NonCopyable&) = delete; + NonCopyable& operator=(NonCopyable&) = delete; }; #include "common/assert.h" -- cgit v1.2.3