[Development] unique_ptr and Qt, Take 2

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Fri May 3 23:54:44 CEST 2019


Il 03/05/19 23:03, Иван Комиссаров ha scritto:
> 
> I’d say it’s an implementation detail - it *is* possible to implement 
> the creation of QObjects more efficient than it is done now without 
> «forcing» user to use objects on stack to avoid allocations.

Unless you also sacrifice binary compatibility, it's not possible.

What it is possible is to have one allocation instead of 2 (the object 
and its dpointer), that's already been worked upon with a custom 
operator new, check the patches on gerrit.

Anyhow this is entirely orthogonal to the original problem at hand: 
ownership. We need to support the case of objects created on the stack 
(not owned and owned).

Cheers,
-- 
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/20190503/4589b2d5/attachment.bin>


More information about the Development mailing list