diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-11-27 17:39:10 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-11-30 17:16:22 +0100 |
commit | 81e893fb2d57b7f2d332f4f626e38f51acf43542 (patch) | |
tree | b8bc1fc0a30a6419f75094433cdf52025e5f0da0 /tests/auto/corelib/global/global.pro | |
parent | 5dab710b90e7041aaa9fcf3631f2ca6af1baab5f (diff) |
QHash: support std::hash as hashing function
In addition (and as a fallback) from requiring qHash, add support
for std::hash specializations. This catches two birds with one stone:
1) users of Qt can simply specialize std::hash for their datatypes,
and use them in both QHash and stdlib unordered associative containers;
2) we get QHash support for any (stdlib) datatype that is hashable
without having to overload qHash for them.
[ChangeLog][QtCore][QHash] QHash, QMultiHash and QSet now support
for key types anything that can be hashed via std::hash, instead of
always requiring a qHash() overload.
Change-Id: Ib5ecba86e4b376d318389500bd24883ac6534c5f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'tests/auto/corelib/global/global.pro')
0 files changed, 0 insertions, 0 deletions