qt5base-lts/tests/auto/corelib
Marc Mutz c2f4705f23 Add qHash(QHash) and qHash(QMultiHash)
The hash function is carefully designed to give the same result
as the straight-forward implementation of qHash(unordered_map),
which we'll probably add at some point, namely: std::accumulate
over a container of std::pair.

This is one reason to use std:: and not QPair in the implemen-
tation of qHash(QHash). The other is that qHash(QPair) uses a
bad hash combiner, which may xor out the 'seed' from the result.

We can't fix that until Qt 6, but the qHash(std::pair) overload
uses the well-known boost::hash_combine algorithm (implemented
in Qt as QtPrivate::QHashCombine), so we can use that.

I also trust std::pair to work without problems with reference
template arguments, while QPair only very recently gained a very
basic auto-test for reference parameters.

[ChangeLog][QtCore] Added qHash() overloads for QHash, QMultiHash.

Change-Id: I90879d8a99cf1aadb6e84ecc0c3704f52f3691da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-07-14 06:53:48 +00:00
..
animation QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
codecs QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
global Merge remote-tracking branch 'origin/5.7' into dev 2016-04-05 14:22:45 +02:00
io Fix/adapt the uses of {to,set,from}Time_t in the qtbase source code 2016-07-06 06:28:13 +00:00
itemmodels QtCore: Remove Windows CE. 2016-03-30 11:22:47 +00:00
json Handle QVariantHash in QJsonDocument::fromVariant 2016-07-13 10:58:02 +00:00
kernel Call disconnectNotify() when disconnecting a QMetaObject::Connection 2016-07-12 16:53:05 +00:00
mimetypes Fix/adapt the uses of {to,set,from}Time_t in the qtbase source code 2016-07-06 06:28:13 +00:00
plugin Merge remote-tracking branch 'origin/5.7' into dev 2016-06-13 12:46:46 +02:00
statemachine Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
thread Merge remote-tracking branch 'origin/5.7' into dev 2016-04-05 14:22:45 +02:00
tools Add qHash(QHash) and qHash(QMultiHash) 2016-07-14 06:53:48 +00:00
xml Merge remote-tracking branch 'origin/5.6' into 5.7 2016-06-10 23:27:10 +02:00
corelib.pro Add support for Apple tvOS 2016-05-17 16:11:23 +00:00