[Development] Out of line move constructors

Volker Hilsheimer volker.hilsheimer at qt.io
Tue Sep 15 09:59:16 CEST 2020

> On 15 Sep 2020, at 01:16, Giuseppe D'Angelo via Development <development at qt-project.org> wrote:
> Il 14/09/20 23:48, Thiago Macieira ha scritto:
>> It's not inline, it's because you didn't define it.
>> To use the extern in the header, you need to add the definition to the .cpp,
>> after the Private class was defined. That effectively means repeating the body
>> of the destructor we extern'ed. So we'd probably need a macro to ensure that.

Makes sense. That’s the part that confused me about your compiler explorer version, where you don’t provide an implementation of the specialization either (or I’m blind).

Adding the implementation (and exporting it) works.

> As commented on the patch, this part of the story that eventually led to the design of QIntrusiveSharedDataPointer -- the previous incantations featured macros and the like, and the commit message talked about trouble in the presence of exported symbols, but I'm not sure what it was referring to. Does anyone remember? If it's no longer an issue, is pinning the smart pointer dtor the way we want to go? How to make it into a public API so that it's not just a Qt-specific trick? (After all, the smart pointers in question have public APIs)

Thanks for doing the archeology Giuseppe.

I think for the QPixmap case we can live with the duplicated implementation.


More information about the Development mailing list