summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qhash.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-12-28 15:58:03 +0100
committerJędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>2015-12-30 11:37:53 +0000
commitd681107f1fcbaabe7da27ac51563434b81b95d8e (patch)
tree5060bcb500d29f3d50c82b640bfcd89bfdd50d2f /src/corelib/tools/qhash.cpp
parentad74c953998133887ac2362800772e0fa01dd3da (diff)
Add qHash(std::pair)
We already include <utility> in <qglobal.h>, so we might as well provide a qHash() overload for std::pair. [ChangeLog][QtCore] Added qHash(std::pair), defined in <QHashFunctions>. Change-Id: I0f61c513e82e05ce9d2e56bcf18f3be9e2da4da9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qhash.cpp')
-rw-r--r--src/corelib/tools/qhash.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 75f1e6a1bc..7520158293 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -711,6 +711,23 @@ void QHashData::checkSanity()
Types \c T1 and \c T2 must be supported by qHash().
*/
+/*!
+ \fn uint qHash(const std::pair<T1, T2> &key, uint seed = 0)
+ \since 5.7
+ \relates QHash
+
+ Returns the hash value for the \a key, using \a seed to seed the calculation.
+
+ Types \c T1 and \c T2 must be supported by qHash().
+
+ \note The return type of this function is \e{not} the same as that of
+ \code
+ qHash(qMakePair(key.first, key.second), seed);
+ \endcode
+ The two functions use different hashing algorithms; due to binary compatibility
+ constraints, we cannot change the QPair algorithm to match the std::pair one before Qt 6.
+*/
+
/*! \fn uint qHashRange(InputIterator first, InputIterator last, uint seed = 0)
\relates QHash
\since 5.5