diff options
author | Harald Fernengel <harald@trolltech.com> | 2009-08-24 08:29:45 (GMT) |
---|---|---|
committer | Harald Fernengel <harald@trolltech.com> | 2009-08-24 08:31:31 (GMT) |
commit | 84081ce91c56168edd686a404b405dcad5f74106 (patch) | |
tree | d87584eafc3fef2079e20253db56529caba275be /src/corelib/tools | |
parent | 94c444e71e6a36cfbd3782416200ff20bdd1cea9 (diff) | |
download | Qt-84081ce91c56168edd686a404b405dcad5f74106.zip Qt-84081ce91c56168edd686a404b405dcad5f74106.tar.gz Qt-84081ce91c56168edd686a404b405dcad5f74106.tar.bz2 |
Remove QScopedCustomPointer
Use QScopedPointer with a custom deleter instead, so we can remove
the awful QScopedCustomPointer once and for all :)
Reviewed-by: Thiago
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qscopedpointer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index 7a3ee14..f801366 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -166,6 +166,11 @@ public: return oldD; } + inline void swap(QScopedPointer<T, Cleanup> &other) + { + qSwap(d, other.d); + } + typedef T *pointer; protected: @@ -175,6 +180,10 @@ private: Q_DISABLE_COPY(QScopedPointer) }; +template <class T, class Cleanup> +Q_INLINE_TEMPLATE void qSwap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) +{ p1.swap(p2); } + template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> > class QScopedArrayPointer : public QScopedPointer<T, Cleanup> { |