diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2015-06-08 15:43:15 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:52:13 +0300 |
commit | f653249cdd4b82b305c6c291b37b05176768e744 (patch) | |
tree | 3f8789bb05372504d61bcec8d0a466153838c5d7 /base/macros.hpp | |
parent | 911e9cb9b8ec6d0377f986cea7a64a23bb955808 (diff) |
Corrections after colleagues comments.
Diffstat (limited to 'base/macros.hpp')
-rw-r--r-- | base/macros.hpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/base/macros.hpp b/base/macros.hpp index 360945ba36..e554dcac96 100644 --- a/base/macros.hpp +++ b/base/macros.hpp @@ -13,11 +13,21 @@ namespace my // Number of elements in array. Compilation error if the type passed is not an array. #define ARRAY_SIZE(X) sizeof(::my::impl::ArraySize(X)) -// Make class noncopyable. -#define NONCOPYABLE(class_name) \ +#define DISALLOW_COPY(className) \ private: \ - class_name const & operator=(class_name const &) = delete; \ - class_name(class_name const &) = delete + className(className const &) = delete; \ + className & operator=(className const &) = delete + + +#define DISALLOW_MOVE(className) \ +private: \ + className(className &&) = delete; \ + className & operator=(className &&) = delete + +#define DISALLOW_COPY_AND_MOVE(className) \ + DISALLOW_COPY(className); \ + DISALLOW_MOVE(className) + ///////////////////////////////////////////////////////////// #define TO_STRING_IMPL(x) #x @@ -66,13 +76,6 @@ namespace my #define UINT64_LO(x) (static_cast<uint32_t>(x & 0xFFFFFFFF)) #define UINT64_HI(x) (static_cast<uint32_t>(x >> 32)) -#define DISALLOW_COPY_AND_MOVE(className) \ -private: \ - className(const className &) = delete; \ - className(className &&) = delete; \ - className & operator=(const className &) = delete; \ - className & operator=(className &&) = delete; - #define NOTIMPLEMENTED() ASSERT(false, ("Function", __func__, "is not implemented!")); #if defined(__GNUC__) |