diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qshareddata.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h index dbf0907a0f..780f2331a8 100644 --- a/src/corelib/tools/qshareddata.h +++ b/src/corelib/tools/qshareddata.h @@ -115,7 +115,11 @@ public: #ifdef Q_COMPILER_RVALUE_REFS QSharedDataPointer(QSharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = nullptr; } inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) Q_DECL_NOTHROW - { qSwap(d, other.d); return *this; } + { + QSharedDataPointer moved(std::move(other)); + swap(moved); + return *this; + } #endif inline bool operator!() const { return !d; } @@ -204,7 +208,11 @@ public: #ifdef Q_COMPILER_RVALUE_REFS inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = nullptr; } inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other) Q_DECL_NOTHROW - { qSwap(d, other.d); return *this; } + { + QExplicitlySharedDataPointer moved(std::move(other)); + swap(moved); + return *this; + } #endif inline bool operator!() const { return !d; } |