[Development] QHash for Qt 6
Giuseppe D'Angelo
giuseppe.dangelo at kdab.com
Fri Dec 20 11:47:55 CET 2019
Il 20/12/19 09:23, Lars Knoll ha scritto:
> The result was that QHash has clear weaknesses compared to other implementations. It uses too much memory and certainly isn’t the fastest implementation. But std::unordered_map is just as bad, so there’s no point in using that to implement QHash.
Just to be devil's advocate, there is... As much as it's fun and
everything implementing a container, just using std::unordered_map would
have minimal effort on our side ("someone else's problem", and it's not
even a random 3rd party, but a mandatory prerequisite for building Qt),
and we can put in our API move-conversion between QHash /
std::unordered_map.
I stopped thinking that Qt should provide "special" data structures (and
for sure we should kill any QHash/QMap usage in our APIs); QHash can be
as bad (or as good) as std::unordered_map, and if people need something
more tailored for their use cases, there's plenty of 3rd parties to
choose from. Or is there a political agenda here trying to promove QHash
usage? :-)
Is the plan to also have QMap be backed by an hybrid solution
(array-backed, etc.), or std::map, or something else?
My 2 c,
--
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20191220/5e95c743/attachment.bin>
More information about the Development
mailing list