QSharedPointer: qHash two arguments support
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Tue, 10 Apr 2012 23:40:36 +0000 (00:40 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 13 Apr 2012 15:05:02 +0000 (17:05 +0200)
Change-Id: I800de3fd9769e4829018360c25a8cf2ee2e2e08b
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qsharedpointer_impl.h

index c656e54..0688f94 100644 (file)
@@ -60,6 +60,7 @@ QT_END_HEADER
 #include <new>
 #include <QtCore/qatomic.h>
 #include <QtCore/qobject.h>    // for qobject_cast
+#include <QtCore/qhash.h>    // for qHash
 
 QT_BEGIN_HEADER
 
@@ -771,11 +772,10 @@ Q_INLINE_TEMPLATE bool operator<(T *ptr1, const QSharedPointer<X> &ptr2)
 //
 // qHash
 //
-template <class T> inline uint qHash(const T *key); // defined in qhash.h
 template <class T>
-Q_INLINE_TEMPLATE uint qHash(const QSharedPointer<T> &ptr)
+Q_INLINE_TEMPLATE uint qHash(const QSharedPointer<T> &ptr, uint seed = 0)
 {
-    return QT_PREPEND_NAMESPACE(qHash)<T>(ptr.data());
+    return QT_PREPEND_NAMESPACE(qHash)(ptr.data(), seed);
 }