[Development] QHash for Qt 6

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Fri Dec 20 21:44:51 CET 2019


Il 20/12/19 16:05, Vitaly Fanaskov ha scritto:
>> I'm not totally sure I understand this point. What do you mean by
>> "memory management"?
> Inside of containers you need to allocate and de-allocate memory. If
> container is passed across a library boundary, there is a question what
> version of new/delete should be used. But this can be "easily" solved by
> providing allocators. Probably.

And this isn't a problem. All over Qt we pass ownership of objects, and 
we have the full 2x2 matrix of "Qt creates object"/"user create object" 
vs "Qt destroys object"/"user destroys object". All of this uses plain 
new and delete.


>> Binary compatibility of stdlib is not an issue
> So, you think that this is easy to achieve binary compatibility with
> many C++ compilers and standard libraries we have? For example, if Qt is
> built with one version of MSVC, but used in a program build with another
> version of MSVC. This is nice if there are some guarantees at least for
> main platforms. I heard that gcc and clang give some guarantees, but
> this not enough, I think.

That is, IMNSHO, 100% not Qt's problem. That ship has sailed, by the 
way; Qt doesn't care any more (and shouldn't care again) about stdlibs 
binary compatibility. We now expose std:: datatypes in Qt ABI.


>> consistency for containers shouldn't really be either
> Regarding consistency, it's not only containers' implementation. This is
> also about Qt APIs consistency: if it will be decided using std::*
> containers, they should be used instead of all Qt containers, but not
> instead of some of them. I guess, we should provide more or less solid
> user experience.

Sorry if I wasn't clear, but I was not saying to use std::* containers 
in our APIs, in lieu of QHash; I was wondering why not to use it in its 
_implementation_ (while fully keeping QHash APIs, behaviors, and so on).

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/6eff0c8d/attachment.bin>


More information about the Development mailing list