On 24/04/2021 01:41, Kevin Kofler via Development wrote:
This particular issue has come up so frequently in the last few weeks that
this behavior change in Qt 6 sounds like a major design flaw of the Qt 6
QHash to me. Also because it subtly breaks source compatibility in a way the
compiler cannot possibly detect, with the worst possible outcome (undefined
behavior). Only a sophisticated static analysis tool has any chance of
catching this, if a dedicated check is written.

The tradeoff is a much faster QHash (and much less allocation-intensive) if you're using it for pure storage; OA has some nice performance benefits, see the Tessil/ABSL's benchmarks.

In general, try to avoid using the Qt containers if you care about algorithmic or behavioural guarantees (and you're not willing to revisit and fix the code every now and then, especially in major version upgrades). Use them for the convenience APIs. Yes, I know, it's tremendously easy to depend on some of these guarantees "by accident" -- Hyrum's law is real, after all.

My 2 c,

--
Giuseppe D'Angelo | [email protected] | 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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to