summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 80b1501d1c..b1434b530e 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -336,6 +336,23 @@ public:
swap(moved);
return *this;
}
+
+ template <class X>
+ QSharedPointer(QSharedPointer<X> &&other) Q_DECL_NOTHROW
+ : value(other.value), d(other.d)
+ {
+ other.d = Q_NULLPTR;
+ other.value = Q_NULLPTR;
+ }
+
+ template <class X>
+ QSharedPointer &operator=(QSharedPointer<X> &&other) Q_DECL_NOTHROW
+ {
+ QSharedPointer moved(std::move(other));
+ swap(moved);
+ return *this;
+ }
+
#endif
template <class X>