diff options
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index b1434b530e..1323dd6b1c 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -362,8 +362,8 @@ public: template <class X> inline QSharedPointer &operator=(const QSharedPointer<X> &other) { - QSHAREDPOINTER_VERIFY_AUTO_CAST(T, X); // if you get an error in this line, the cast is invalid - internalCopy(other); + QSharedPointer copy(other); + swap(copy); return *this; } @@ -527,18 +527,6 @@ private: enableSharedFromThis(ptr); } - template <class X> - inline void internalCopy(const QSharedPointer<X> &other) - { - Data *o = other.d; - T *actual = other.value; - if (o) - other.ref(); - qSwap(d, o); - qSwap(this->value, actual); - deref(o); - } - void internalSwap(QSharedPointer &other) Q_DECL_NOTHROW { qSwap(d, other.d); |