qt5base-lts/tests/auto
Marc Mutz 08373fb02d Add qHashRange and qHashRangeCommutative
qHashRange() takes an (input iterator) range and hashes each element, combining
the hash values using the hash combiner from Boost/N1837 with the magic number
0x9e3779b9, as described here:
http://stackoverflow.com/questions/4948780/magic-number-in-boosthash-combine

qHashRangeCommutative() does the same but with a cummutative combiner (unsigned
addition) to create hash values that are order-independent, e.g. for hashed
containers. The obvious combiner, XOR, is a bad one because it eliminates
duplicate elements. Signed addition cannot be used, since signed overflow
leads to undefined behavior.

[ChangeLog][QtCore] Added qHashRange() and qHashRangeCommutative() functions to aid
implementing qHash() overloads for custom types.

Change-Id: I3c2bbc9ce4bd0455262a70e0cf248486525e534f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-09 12:05:35 +01:00
..
android Remove old test script & project. 2014-12-20 07:42:09 +01:00
bic/data test: Add 5.1.0 bic data for linux-gcc-ia32 2013-07-08 21:47:36 +02:00
cmake Fix cmake test_moc_macro_target with namespace 2014-12-30 10:05:58 +01:00
compilerwarnings/data Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
concurrent Update license headers and add new license files 2014-09-24 12:26:19 +02:00
corelib Add qHashRange and qHashRangeCommutative 2015-01-09 12:05:35 +01:00
dbus Remove the old QDBusConnection::sender functionality 2015-01-06 19:41:36 +01:00
gui Merge remote-tracking branch 'origin/5.4' into dev 2014-12-29 16:37:38 +01:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network Merge remote-tracking branch 'origin/5.4' into dev 2014-12-29 16:37:38 +01:00
opengl Change bugreports.qt-project.org -> bugreports.qt.io 2014-12-18 09:46:09 +01:00
other Merge remote-tracking branch 'origin/5.4' into dev 2014-12-18 12:12:58 +01:00
printsupport Change bugreports.qt-project.org -> bugreports.qt.io 2014-12-18 09:46:09 +01:00
shared Android: Keyboard doesn't hide from done button 2014-10-25 07:19:35 +02:00
sql Adjust DBMSType to DbmsType to follow conventions 2014-11-26 10:47:32 +01:00
testlib Update license headers and add new license files 2014-09-24 12:26:19 +02:00
tools Add annotation to rename methods created by qdbusxml2cpp 2015-01-05 12:29:14 +01:00
widgets tst_QWidget: include QTest, not QtTest 2015-01-06 22:53:19 +01:00
xml Fix QDomDocument::importNode() crashing on null nodes 2014-10-07 23:08:18 +02:00
auto.pro Temporarily disable the QtDBus tests if the session bus isn't available 2014-12-23 12:22:56 +01:00
network-settings.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qtest-config.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
test.pl Update license headers and add new license files 2014-09-24 12:26:19 +02:00