diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-02-24 17:33:25 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-26 23:43:10 +0100 |
commit | 2a771cef4a939d26f6ffc45caa690330b33882c9 (patch) | |
tree | 57583b081c64cbdc2cbe97eb0e30a505211ec495 /src | |
parent | e34ee3127043773a037bfd18a2d457d409032ee5 (diff) |
QFlags<>: let the compiler generate copy ctor/op=
The user-defined copy constructor and
copy-assignment operators were 100% equivalent
to the ones the compiler would generate, so
let the compiler generate them (so we reap
move constructors, too, even though they're
not needed on this class).
Change-Id: Iecdd579fa5a819d083ec9b2f25734ddba85515e6
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qglobal.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 47d56d7c1b..b159a877b7 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1225,12 +1225,15 @@ class QFlags int i; public: typedef Enum enum_type; - Q_DECL_CONSTEXPR inline QFlags(const QFlags &f) : i(f.i) {} + // compiler-generated copy/move ctor/assignment operators are fine! +#ifdef qdoc + inline QFlags(const QFlags &other); + inline QFlags &operator=(const QFlags &other); +#endif Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {} Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {} inline QFlags(QFlag f) : i(f) {} - inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; } inline QFlags &operator&=(int mask) { i &= mask; return *this; } inline QFlags &operator&=(uint mask) { i &= mask; return *this; } inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } |