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 <[email protected]> Sent: Wednesday, September 9, 2020 4:20 PM To: Andrei Golubev <[email protected]> Cc: [email protected] <[email protected]> Subject: Re: [Development] Important recent changes in QList/QString/QByteArray On Wed, 9 Sep 2020 at 11:58, Andrei Golubev <[email protected]> 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 [email protected] https://lists.qt-project.org/listinfo/development
