Go to file
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
bin Merge remote-tracking branch 'origin/5.6.0' into 5.7 2016-03-07 17:08:56 +01:00
config.tests Call arch test through the new qmake based configure system 2016-07-02 06:18:32 +00:00
dist Add Qt 5.7.0 changelog 2016-06-10 06:48:56 +00:00
doc Merge remote-tracking branch 'origin/5.6' into 5.7 2016-06-29 10:10:22 +02:00
examples Fix/adapt the uses of {to,set,from}Time_t in the qtbase source code 2016-07-06 06:28:13 +00:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
mkspecs Replace EXTRA_LIBS with EXTRA_LIBDIR and EXTRA_FRAMEWORKPATH 2016-07-13 19:51:34 +00:00
qmake Remove the -target command line option 2016-07-05 15:49:03 +00:00
src Add qHash(QHash) and qHash(QMultiHash) 2016-07-14 06:53:48 +00:00
tests Add qHash(QHash) and qHash(QMultiHash) 2016-07-14 06:53:48 +00:00
tools Remove the -version-override command line arguments in configure.exe 2016-07-14 06:07:09 +00:00
util Re-generate QLocale data from CLDR v29 2016-04-08 03:51:18 +00:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore Ignore more build artifacts from in-source builds. 2016-06-16 07:06:37 +00:00
.qmake.conf Merge remote-tracking branch 'origin/5.7' into dev 2016-05-23 21:09:46 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
config_help.txt Remove -fw and -l command line arguments 2016-07-13 19:51:17 +00:00
configure Handle the -[no]make command line arguments in qmake 2016-07-02 06:18:55 +00:00
configure.bat Ensure that configure.exe is built in C++11 mode with ICC 2016-06-17 16:28:11 +00:00
configure.json Remove -fw and -l command line arguments 2016-07-13 19:51:17 +00:00
configure.pri Replace EXTRA_LIBS with EXTRA_LIBDIR and EXTRA_FRAMEWORKPATH 2016-07-13 19:51:34 +00:00
header.BSD Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.BSD-OLD Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.COMM Add header template for commercial only modules 2015-10-19 10:37:18 +00:00
header.FDL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.FDL-OLD Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.GPL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.GPL-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL3 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL3-COMM Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL21 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL-NOGPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
header.LGPL-ONLY Update copyright headers 2015-02-11 06:49:51 +00:00
INSTALL Doc: Update links in INSTALL file 2015-02-16 09:06:41 +00:00
LGPL_EXCEPTION.txt Update copyright headers 2015-02-11 06:49:51 +00:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPLv21 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.PREVIEW.COMMERCIAL Add new license header templates and license files 2016-01-14 20:43:46 +00:00
qtbase.pro Remove the -qconfig command line argument 2016-04-19 14:01:40 +00:00
sync.profile Add qtdbusglobal.h and qtdbusglobal_p.h 2016-07-14 06:06:43 +00:00