diff options
Diffstat (limited to 'src/corelib/tools/qsharedpointer.cpp')
-rw-r--r-- | src/corelib/tools/qsharedpointer.cpp | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index a24b689181..bc7a5f80d7 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -479,6 +479,46 @@ */ /*! + \fn template <class T> QSharedPointer<T>::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 <class T> QSharedPointer<T>::operator=(QSharedPointer &&other) + + Move-assigns \a other to this QSharedPointer instance. + + \since 5.0 +*/ + +/*! + \fn template <class T> template <class X> QSharedPointer<T>::QSharedPointer(QSharedPointer<X> &&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 <class T> template <class X> QSharedPointer<T>::operator=(QSharedPointer<X> &&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 <class T> QSharedPointer<T>::QSharedPointer(const QWeakPointer<T> &other) Creates a QSharedPointer by promoting the weak reference \a other @@ -932,6 +972,15 @@ */ /*! + \fn template <class T> qHash(const QSharedPointer<T> &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 <class T> template <class X> bool operator==(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) \relates QSharedPointer @@ -1400,7 +1449,7 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge } // we can create the refcount data because it doesn't exist - ExternalRefCountData *x = new ExternalRefCountData(Qt::Uninitialized); + ExternalRefCountData *x = ::new ExternalRefCountData(Qt::Uninitialized); x->strongref.storeRelaxed(-1); x->weakref.storeRelaxed(2); // the QWeakPointer that called us plus the QObject itself @@ -1411,7 +1460,7 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge // ~ExternalRefCountData has a Q_ASSERT, so we use this trick to // only execute this if Q_ASSERTs are enabled Q_ASSERT((x->weakref.storeRelaxed(0), true)); - delete x; + ::delete x; ret->weakref.ref(); } return ret; |