Merge "Libbase: add C++11 support to DISALLOW_IMPLICIT_CONSTRUCTORS" am: e7f3a0f9cf

am: f4878c6b88

Change-Id: I6034288ab01774e75bd101ad8625f334de94877c
This commit is contained in:
Andreas Gampe 2016-08-29 19:15:08 +00:00 committed by android-build-merger
commit 95606ec918
1 changed files with 9 additions and 0 deletions

View File

@ -60,9 +60,18 @@
// This should be used in the private: declarations for a class
// that wants to prevent anyone from instantiating it. This is
// especially useful for classes containing only static methods.
//
// When building with C++11 toolchains, just use the language support
// for explicitly deleted methods.
#if __cplusplus >= 201103L
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
TypeName() = delete; \
DISALLOW_COPY_AND_ASSIGN(TypeName)
#else
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
TypeName(); \
DISALLOW_COPY_AND_ASSIGN(TypeName)
#endif
// The arraysize(arr) macro returns the # of elements in an array arr.
// The expression is a compile-time constant, and therefore can be