diff options
author | Janne Koskinen <janne.p.koskinen@digia.com> | 2009-08-18 14:44:21 (GMT) |
---|---|---|
committer | Janne Koskinen <janne.p.koskinen@digia.com> | 2009-08-18 14:44:21 (GMT) |
commit | 3d6056dfe01116e34a2b47a70fb95e73753ef766 (patch) | |
tree | ee4e1430dc9f0b06ab89091682d5a60525eac560 /src/corelib/tools/qshareddata.h | |
parent | 52e469a629d32b7f7e52518874dab13fcd4bb814 (diff) | |
parent | 69689f3527f373618a1f4adad543b60afea46c17 (diff) | |
download | Qt-3d6056dfe01116e34a2b47a70fb95e73753ef766.zip Qt-3d6056dfe01116e34a2b47a70fb95e73753ef766.tar.gz Qt-3d6056dfe01116e34a2b47a70fb95e73753ef766.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/corelib/tools/qshareddata.h')
-rw-r--r-- | src/corelib/tools/qshareddata.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h index e13e37c..dde6e88 100644 --- a/src/corelib/tools/qshareddata.h +++ b/src/corelib/tools/qshareddata.h @@ -111,6 +111,9 @@ public: inline bool operator!() const { return !d; } + inline void swap(QSharedDataPointer &other) + { qSwap(d, other.d); } + protected: T *clone(); @@ -186,6 +189,9 @@ public: inline bool operator!() const { return !d; } + inline void swap(QExplicitlySharedDataPointer &other) + { qSwap(d, other.d); } + protected: T *clone(); @@ -235,6 +241,14 @@ template <class T> Q_INLINE_TEMPLATE QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) : d(adata) { if (d) d->ref.ref(); } +template <class T> +Q_INLINE_TEMPLATE void qSwap(QSharedDataPointer<T> &p1, QSharedDataPointer<T> &p2) +{ p1.swap(p2); } + +template <class T> +Q_INLINE_TEMPLATE void qSwap(QExplicitlySharedDataPointer<T> &p1, QExplicitlySharedDataPointer<T> &p2) +{ p1.swap(p2); } + QT_END_NAMESPACE QT_END_HEADER |