[Development] The future of smart pointers in Qt API

Vitaly Fanaskov vitaly.fanaskov at qt.io
Wed Feb 12 10:34:12 CET 2020


> You seem to repeat your initial statements.
Yes, because most of the participants of this discussion tend to agree, 
as far as I can see.

On 2/11/20 8:19 PM, André Pönitz wrote:
> On Tue, Feb 11, 2020 at 03:15:11PM +0000, Vitaly Fanaskov wrote:
>> I want to summarize intermediate results of the discussion and return it
>> back to the track.
>>
>>
>> Subject: using smart pointers in the API.
>> Good idea. Better to use than not because of automatic lifetime
>> management,
> *shrug*
>
> You seem to repeat your initial statements.
>
> QObject parents _do_ manage lifetime to start with.
>
>> Subject: raw pointers for passing mandatory parameters vs. using
>> references.
>> Allow both approaches, recommend using references (and/or smart
>> pointers) when acceptable.
>> Not too many arguments collected here, just
>> try to make Qt API more modern.
> Again only your statement.
>
> The issue itself has been discussed over and over again.
>
> Allowing _both_ I have not seen actively endorsed by anyone,
> this only makes a messy incosnsistent API.
>
>> There are a few irrelevant discussions. Start a new thread if you want
>> to continue discussing them, please.
>>
>> Irrelevant subject: smart pointers vs. parent-child lifetime management
>> model.
> Sure. Because it would void the 'lifetime management' line of reasoning.
>
> Andre'

-- 
Best Regards,

Fanaskov Vitaly
Senior Software Engineer

The Qt Company / Qt Quick and Widgets Team



More information about the Development mailing list