diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2011-02-21 10:12:36 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2011-02-21 13:38:42 (GMT) |
commit | 210ec8b1363569cd459dd3ce0172eea8e4ef0998 (patch) | |
tree | 9a4fdb523ea85893f72da35f1111005ccf027d76 | |
parent | b17f7c13834eccc056c14d682788354f6fa00f88 (diff) | |
download | Qt-210ec8b1363569cd459dd3ce0172eea8e4ef0998.zip Qt-210ec8b1363569cd459dd3ce0172eea8e4ef0998.tar.gz Qt-210ec8b1363569cd459dd3ce0172eea8e4ef0998.tar.bz2 |
Fix the move semantics in QSharedDataPointer and QExplicitSDP
Reviewed-by: Olivier Goffart
-rw-r--r-- | src/corelib/tools/qshareddata.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h index 1bdba2c..2b97d2d 100644 --- a/src/corelib/tools/qshareddata.h +++ b/src/corelib/tools/qshareddata.h @@ -114,6 +114,7 @@ public: return *this; } #ifdef Q_COMPILER_RVALUE_REFS + QSharedDataPointer(QSharedDataPointer &&o) : d(o.d) { o.d = 0; } inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) { qSwap(d, other.d); return *this; } #endif @@ -197,7 +198,10 @@ public: return *this; } #ifdef Q_COMPILER_RVALUE_REFS - inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) + inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) : d(o.d) { o.d = 0; } + inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other) + { qSwap(d, other.d); return *this; } + inline QExplicitlySharedDataPointer &operator=(QSharedDataPointer<T> &&other) { qSwap(d, other.d); return *this; } #endif |