QSharedPointer: qHash two arguments support

Change-Id: I800de3fd9769e4829018360c25a8cf2ee2e2e08b
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Giuseppe D'Angelo 2012-04-11 00:40:36 +01:00 committed by Qt by Nokia
parent 1424702918
commit bcedd0e242
1 changed files with 3 additions and 3 deletions

View 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);
}