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 | [email protected] | 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

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to