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 + QSharedPointer(QSharedPointer &&other) Q_DECL_NOTHROW + : value(other.value), d(other.d) + { + other.d = Q_NULLPTR; + other.value = Q_NULLPTR; + } + + template + QSharedPointer &operator=(QSharedPointer &&other) Q_DECL_NOTHROW + { + QSharedPointer moved(std::move(other)); + swap(moved); + return *this; + } + #endif template