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

Andrei Golubev andrei.golubev at qt.io
Thu Sep 10 11:50:36 CEST 2020


But reallocating on erase still falls under the problem that it
invalidates everything, including the part before the erased range.

Indeed. This is why I mentioned it in the first place. This can be "disabled" by calling reserve().
Anyhow, I am not against any of the options: have shrinking optimization or not in erase(). It would just be good to know why it was needed (or thought of) initially.


--
Best Regards,
Andrei
________________________________
From: Development <development-bounces at qt-project.org> on behalf of Giuseppe D'Angelo via Development <development at qt-project.org>
Sent: Thursday, September 10, 2020 12:29 PM
To: development at qt-project.org <development at qt-project.org>
Subject: Re: [Development] Important recent changes in QList/QString/QByteArray

Il 10/09/20 08:48, Andrei Golubev ha scritto:
>
>     That's the dilemma that Andrei was talking about. Either solution is
>     valid and
>     both have a way for you to tell QList to do what you want.
>
> Oh, but it's not a question of "if". It is already done in latest dev
> this way, the shrinking erase, I mean (not sure who was an author of the
> original change).

But reallocating on erase still falls under the problem that it
invalidates everything, including the part before the erased range.

--
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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200910/53fe6e6f/attachment.html>


More information about the Development mailing list