Add a macro to allow default move copy constructor and assignment operator above VS2013.

This commit is contained in:
Chunting Gu
2018-09-05 15:41:16 +08:00
parent 74172b5b0c
commit cff4888182
2 changed files with 24 additions and 1 deletions
+12
View File
@@ -6,6 +6,18 @@
// -----------------------------------------------------------------------------
// Macros
// Does the compiler support "= default" for move copy constructor and
// assignment operator?
#ifdef _MSC_VER
#if _MSC_VER <= 1800 // VS 2013
#define WEBCC_DEFAULT_MOVE_COPY_ASSIGN 0
#else
#define WEBCC_DEFAULT_MOVE_COPY_ASSIGN 1
#endif // _MSC_VER <= 1800
#else
#define WEBCC_DEFAULT_MOVE_COPY_ASSIGN 1
#endif // _MSC_VER
// Explicitly declare the copy constructor and assignment operator as deleted.
#define DELETE_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \