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

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue Sep 1 19:46:21 CEST 2020


Il 01/09/20 19:31, Thiago Macieira ha scritto:
> There's no violation. Your code was incorrect in the past, it just happened to
> work.

This isn't true...


> Assume any and all non-const function will invalidate iterators.

... because this is sketchy. It has never been 100% documented, but 
de-facto "the" behavor everyone is relying upon, due to Hyrum's law.

I don't have the energy to fight this, but my question was same lines -- 
legalese / documentation: what's the guaranteed behavior?

Pedantically: if any and all non-const function will invalidate 
iterators, then calling any algorithm that takes an iterator range 
becomes formally impossible (unless one obtains an iterator range in one 
function call, but QVector doesn't have that).

My 2 c,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200901/a513f728/attachment.bin>


More information about the Development mailing list