[Development] The future of smart pointers in Qt API

André Pönitz apoenitz at t-online.de
Tue Feb 11 20:19:36 CET 2020


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'


More information about the Development mailing list