diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index 65c1c144f14..3fa9bbd0d81 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -442,6 +442,46 @@ get a compiler error. */ +/*! + \fn template QSharedPointer::QSharedPointer(QSharedPointer &&other) + + Move-constructs a QSharedPointer instance, making it point at the same + object that \a other was pointing to. + + \since 5.4 +*/ + +/*! + \fn template QSharedPointer::operator=(QSharedPointer &&other) + + Move-assigns \a other to this QSharedPointer instance. + + \since 5.0 +*/ + +/*! + \fn template template QSharedPointer::QSharedPointer(QSharedPointer &&other) + + Move-constructs a QSharedPointer instance, making it point at the same + object that \a other was pointing to. + + This constructor participates in overload resolution only if \c{X*} + implicitly converts to \c{T*}. + + \since 5.6 +*/ + +/*! + \fn template template QSharedPointer::operator=(QSharedPointer &&other) + + Move-assigns \a other to this QSharedPointer instance. + + This assignment operator participates in overload resolution only if \c{X*} + implicitly converts to \c{T*}. + + \since 5.6 +*/ + /*! \fn template QSharedPointer::QSharedPointer(const QWeakPointer &other) @@ -895,6 +935,15 @@ Const overload of sharedFromThis(). */ +/*! + \fn template qHash(const QSharedPointer &key, size_t seed) + \relates QSharedPointer + + Returns the hash value for \a key, using \a seed to seed the calculation. + + \since 5.0 +*/ + /*! \fn template template bool operator==(const QSharedPointer &ptr1, const QSharedPointer &ptr2) \relates QSharedPointer diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h index a18304cae6e..2a60f3ca5e2 100644 --- a/src/corelib/tools/qsharedpointer.h +++ b/src/corelib/tools/qsharedpointer.h @@ -48,6 +48,11 @@ public: QSharedPointer &operator=(QSharedPointer &&other) noexcept; QSharedPointer &operator=(const QWeakPointer &other); + template + QSharedPointer(QSharedPointer && other) noexcept; + template + QSharedPointer &operator=(QSharedPointer && other) noexcept; + void swap(QSharedPointer &other) noexcept; QWeakPointer toWeakRef() const; @@ -69,6 +74,9 @@ public: static inline QSharedPointer create(Args &&... args); }; +template +size_t qHash(const QSharedPointer &key, size_t seed = 0) noexcept; + template class QWeakPointer {