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

Thiago Macieira thiago.macieira at intel.com
Wed Sep 2 16:37:14 CEST 2020

On Wednesday, 2 September 2020 05:28:33 PDT Ville Voutilainen wrote:
> No. I mean "before", not "after". That's how std::vector works. An
> erase is a shrinking operation
> that keeps everything before the erased position untouched and
> left-shifts everything after it. If you
> want a prepend optimization, you can get it without changing the way
> erase works and what the
> invalidation guarantees of erase are, so I'd like to understand what
> in our implementation strategy
> necessitates this change to those guarantees.

I thought QVector and the older QList could decide that the container's 
allocated space was too big compared to the the number of elements and 
reallocate on erase() too. This doesn't seem like a new requirement.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering

More information about the Development mailing list