diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-07-05 17:05:13 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-05 18:24:36 +0200 |
commit | 60cb6d7f3b7b3daa4b56a448403fa66bdd292856 (patch) | |
tree | 534e33b712962fab8a93d268eceb681bb357a5b5 /src/corelib | |
parent | 21c4f1806e3cc1f9893ddedfa68000a750eb1fdc (diff) |
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 <qt_sanity_bot@ovi.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qglobal.h | 6 |
1 files changed, 6 insertions, 0 deletions
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); |