Use C++11 deleted functions to implement DISALLOW_ macros

With C++ deleted functions, compilers can generate more
descriptive error messages when we are doing something disallowed.

Change-Id: I48d23e5eced545732558e56f5ff9ff70c95a6ff0
This commit is contained in:
Yohei Yukawa 2014-03-06 20:48:43 +09:00
parent ca0a0da864
commit 72c362985c

View file

@ -352,13 +352,13 @@ template<typename T> AK_FORCE_INLINE const T &max(const T &a, const T &b) { retu
#define MIN_OUTPUT_INDEX_FOR_DEBUG (-1)
#define DISALLOW_DEFAULT_CONSTRUCTOR(TypeName) \
TypeName()
TypeName() = delete
#define DISALLOW_COPY_CONSTRUCTOR(TypeName) \
TypeName(const TypeName&)
TypeName(const TypeName&) = delete
#define DISALLOW_ASSIGNMENT_OPERATOR(TypeName) \
void operator=(const TypeName&)
void operator=(const TypeName&) = delete
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
DISALLOW_COPY_CONSTRUCTOR(TypeName); \