summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qshareddata.h
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-21 08:59:26 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-21 08:59:26 +0100
commitcc920b4cddc170a7442d8fdfb53076c208a3d71e (patch)
treee4757cffe420bd3c61dda1d369b452a0fac9eff7 /src/corelib/tools/qshareddata.h
parentc8c8cc790a315710b0dae2282dc32e3472e107ee (diff)
parentfc8fd508165c8e4dcfe0da397b63cf99f15178e3 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/corelib/tools/qshareddata.h')
-rw-r--r--src/corelib/tools/qshareddata.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index f5572f3a00..3ef134a99d 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; }
@@ -216,7 +220,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; }