[Development] Out of line move constructors

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Mon Sep 14 12:37:00 CEST 2020


Hi,

Many pimpled types in Qt lack a move constructor.

History: back in the day, when C++11 wasn't a requirement and binary 
compatibility between C++98/C++11 was to be kept, we had to implement 
C++11-only code (such as move operations) inline. This however isn't 
possible for move constructors if the type is implemented using pimpl 
(with or without refcounting).

Coming 5.9, C++11 became a requirement. Still we didn't add move 
constructors for pimpled types; the rationale was that we wanted move 
operations to be inline. For refcounted types, the idea was to achieve 
that (I think) by using something like QIntrusiveSharedPointer instead 
of Q(E)SDP.

Anyhow: is this still the policy, or do we want to start adding out of 
line move constructors?

Thanks,
-- 
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/20200914/045478d7/attachment.bin>


More information about the Development mailing list