From 6ad71c216b2d1112c96d621140c60b4e1b359811 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Wed, 6 May 2015 04:05:02 -0300 Subject: Common: Move NonCopyable to common_types.h --- src/common/common_types.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/common/common_types.h') diff --git a/src/common/common_types.h b/src/common/common_types.h index 1b453e7f..5c004c5f 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h @@ -73,6 +73,16 @@ union t64 { u8 _u8[8]; ///< 8-bit unsigned char(s) }; +// An inheritable class to disallow the copy constructor and operator= functions +class NonCopyable { +protected: + NonCopyable() = default; + ~NonCopyable() = default; + + NonCopyable(NonCopyable&) = delete; + NonCopyable& operator=(NonCopyable&) = delete; +}; + namespace Common { /// Rectangle data structure class Rect { -- cgit v1.2.3