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

Thiago Macieira thiago.macieira at intel.com
Tue Sep 1 20:59:00 CEST 2020


On Tuesday, 1 September 2020 10:41:33 PDT Giuseppe D'Angelo via Development 
wrote:
> This is the contract, and it's OK. I don't think however that this is
> what was intended by OP. Rather, that calling a non-const function may
> repack/reallocate a QCC (*), causing invalidation of all references and
> iterators, even if the container was NOT shared in the first place.
> 
> Did I misunderstand the problem?

I hope you are. Calling begin() on a container that is already detached() 
shouldn't cause it to reallocate if it was already unshared. Calling prepend() 
or append() might.

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





More information about the Development mailing list