I don't understand what this means. Am I supposed to reserve a
container to its current size before erasing elements
from it, if I don't want the erase to shrink it?
Yes.

--
Best Regards,
Andrei
________________________________
From: Ville Voutilainen <ville.voutilai...@gmail.com>
Sent: Wednesday, September 9, 2020 4:20 PM
To: Andrei Golubev <andrei.golu...@qt.io>
Cc: development@qt-project.org <development@qt-project.org>
Subject: Re: [Development] Important recent changes in QList/QString/QByteArray

On Wed, 9 Sep 2020 at 11:58, Andrei Golubev <andrei.golu...@qt.io> wrote:
> On the other hand, "please do not free memory, I still need it" use-case is 
> also justified. However, chances are that when you really need a certain 
> memory to be allocated/preserved, there is a call to QList::reserve() prior 
> to insertions/deletions. And since we do not shrink in case of reserved 
> memory, users should be safe in this case, in general.

I don't understand what this means. Am I supposed to reserve a
container to its current size before erasing elements
from it, if I don't want the erase to shrink it?
_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to