[Development] Important recent changes in QList/QString/QByteArray
Thiago Macieira
thiago.macieira at intel.com
Thu Sep 10 04:31:59 CEST 2020
On Wednesday, 9 September 2020 02:17:52 PDT Giuseppe D'Angelo via Development
wrote:
> > *- except when detach is necessary or shrinking happens
>
> This is another against automatic shrinking; it may invalidate
> everything rather than just the erased area. I don't understand the
> "detach" part, is it about holding references across a detach, so they
> refer to the original container, not the detached one? That's not
> different from we always had, isn't it?
It means that if you try to erase from a container that is currently shared,
it will detach. When it does, the detached container's size will be evaluated
in terms of the size of the container, not the capacity the shared container
had.
Obviously all iterators in a recently-detached container point to newly
allocated memory, not to the original memory.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel DPG Cloud Engineering
More information about the Development
mailing list