summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qtypeinfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qtypeinfo.h')
-rw-r--r--src/corelib/global/qtypeinfo.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index 48ee99ef27..de484006c5 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -166,23 +166,23 @@ Q_DECLARE_TYPEINFO_BODY(QFlags<T>, Q_PRIMITIVE_TYPE);
/*
Specialize a shared type with:
- Q_DECLARE_SHARED(type);
+ Q_DECLARE_SHARED(type)
where 'type' is the name of the type to specialize. NOTE: shared
- types must declare a 'bool isDetached(void) const;' member for this
- to work.
+ types must define a member-swap, and be defined in the same
+ namespace as Qt for this to work.
*/
#define Q_DECLARE_SHARED_STL(TYPE) \
QT_END_NAMESPACE \
namespace std { \
template<> inline void swap<QT_PREPEND_NAMESPACE(TYPE)>(QT_PREPEND_NAMESPACE(TYPE) &value1, QT_PREPEND_NAMESPACE(TYPE) &value2) \
- { swap(value1.data_ptr(), value2.data_ptr()); } \
+ { value1.swap(value2); } \
} \
QT_BEGIN_NAMESPACE
#define Q_DECLARE_SHARED(TYPE) \
template <> inline void qSwap<TYPE>(TYPE &value1, TYPE &value2) \
-{ qSwap(value1.data_ptr(), value2.data_ptr()); } \
+{ value1.swap(value2); } \
Q_DECLARE_SHARED_STL(TYPE)
/*