Add define for C++11 explict delete methods

Change-Id: Ief4b8949acb528dcfc0be725b562ae71bd1640cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Stephen Kelly 2012-01-08 20:00:14 +01:00 committed by Qt by Nokia
parent 75ab5a15c4
commit 696a6b57d1

View File

@ -1071,6 +1071,12 @@ redefine to built-in booleans to make autotests work properly */
# define Q_NULLPTR 0
#endif
#ifdef Q_COMPILER_DEFAULT_DELETE_MEMBERS
# define Q_DECL_EQ_DELETE = delete
#else
# define Q_DECL_EQ_DELETE
#endif
#ifdef Q_COMPILER_CONSTEXPR
# define Q_DECL_CONSTEXPR constexpr
#else
@ -2443,15 +2449,9 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1);
classes contains a private copy constructor and assignment
operator to disable copying (the compiler gives an error message).
*/
#ifdef Q_COMPILER_DEFAULT_DELETE_MEMBERS
#define Q_DISABLE_COPY(Class) \
Class(const Class &) = delete;\
Class &operator=(const Class &) = delete;
#else
#define Q_DISABLE_COPY(Class) \
Class(const Class &); \
Class &operator=(const Class &);
#endif
Class(const Class &) Q_DECL_EQ_DELETE;\
Class &operator=(const Class &) Q_DECL_EQ_DELETE;
class QByteArray;
Q_CORE_EXPORT QByteArray qgetenv(const char *varName);