summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-29 11:16:43 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-29 11:16:43 (GMT)
commit28c004a2750205750735ccb7a46549c376673434 (patch)
tree34d73a7d5a058c531bd30eba4c3d67be23272cc5 /src/corelib/tools
parent8943b44c38ee6244c4a5b190c2b35879b1921843 (diff)
parent4bfd68ccbda50fa3336d6ee6875d87b1b308b870 (diff)
downloadQt-28c004a2750205750735ccb7a46549c376673434.zip
Qt-28c004a2750205750735ccb7a46549c376673434.tar.gz
Qt-28c004a2750205750735ccb7a46549c376673434.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: qSwap: use std::swap as implementation, and specialize std::swap for our container
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qscopedpointer.h12
-rw-r--r--src/corelib/tools/qshareddata.h14
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h10
3 files changed, 36 insertions, 0 deletions
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index 40d3851..a24cc71 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -186,6 +186,18 @@ template <class T, class Cleanup>
Q_INLINE_TEMPLATE void qSwap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2)
{ p1.swap(p2); }
+#ifndef QT_NO_STL
+QT_END_NAMESPACE
+namespace std {
+ template <class T, class Cleanup>
+ Q_INLINE_TEMPLATE void swap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2)
+ { p1.swap(p2); }
+}
+QT_BEGIN_NAMESPACE
+#endif
+
+
+
namespace QtPrivate {
template <typename X, typename Y> struct QScopedArrayEnsureSameType;
template <typename X> struct QScopedArrayEnsureSameType<X,X> { typedef X* Type; };
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index b646a9d..1079595 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -263,6 +263,20 @@ template <class T>
Q_INLINE_TEMPLATE void qSwap(QExplicitlySharedDataPointer<T> &p1, QExplicitlySharedDataPointer<T> &p2)
{ p1.swap(p2); }
+#ifndef QT_NO_STL
+QT_END_NAMESPACE
+namespace std {
+ template <class T>
+ Q_INLINE_TEMPLATE void swap(QSharedDataPointer<T> &p1, QSharedDataPointer<T> &p2)
+ { p1.swap(p2); }
+
+ template <class T>
+ Q_INLINE_TEMPLATE void swap(QExplicitlySharedDataPointer<T> &p1, QExplicitlySharedDataPointer<T> &p2)
+ { p1.swap(p2); }
+}
+QT_BEGIN_NAMESPACE
+#endif
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 4b47713..965ac14 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -784,6 +784,16 @@ inline void qSwap(QSharedPointer<T> &p1, QSharedPointer<T> &p2)
p1.swap(p2);
}
+#ifndef QT_NO_STL
+QT_END_NAMESPACE
+namespace std {
+ template <class T>
+ inline void swap(QSharedPointer<T> &p1, QSharedPointer<T> &p2)
+ { p1.swap(p2); }
+}
+QT_BEGIN_NAMESPACE
+#endif
+
namespace QtSharedPointer {
// helper functions:
template <class X, class T>