[Development] Important recent changes in QList/QString/QByteArray

Ville Voutilainen ville.voutilainen at gmail.com
Wed Sep 9 15:20:29 CEST 2020

On Wed, 9 Sep 2020 at 11:58, Andrei Golubev <andrei.golubev at 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?

More information about the Development mailing list