From 60cb6d7f3b7b3daa4b56a448403fa66bdd292856 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 5 Jul 2011 17:05:13 +0200 Subject: Make use of deleted members in Q_DISABLE_COPY Might help the compiler to produce better error message. Change-Id: I1df3c32084b9ecda0b2a140776ad5f57adfb2e6e Reviewed-by: Thiago Reviewed-on: http://codereview.qt.nokia.com/1177 Reviewed-by: Qt Sanity Bot Reviewed-by: Denis Dzyubenko --- src/corelib/global/qglobal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index e769c43cef..204652f7c1 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2407,9 +2407,15 @@ 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 QByteArray; Q_CORE_EXPORT QByteArray qgetenv(const char *varName); -- cgit v1.2.3