[Development] QList for Qt 6
Konstantin Shegunov
kshegunov at gmail.com
Thu May 23 12:54:24 CEST 2019
On Thu, May 23, 2019 at 12:15 PM Shawn Rutledge <Shawn.Rutledge at qt.io>
wrote:
> > On 23 May 2019, at 07:51, Konstantin Shegunov <kshegunov at gmail.com>
> wrote:
> > Yes, exactly like, though it'd need to regrow automatically; and on
> regrow it may need to normalize the order of elements (hence the
> "amortized”).
>
> When should it regrow? It’s part of the definition that it overwrites the
> oldest elements when you try to insert too much data.
>
Yes, I meant specifically for the QQueue, we'd want it to grow so we can
accommodate the data. The most obvious thing that comes to mind for the
regrowth is when you need an element and the begin iterator (i.e. pointer)
is end iterator + 1. It does waste one element, but on the other hand
allows to easily distinguish between an empty buffer and a full one.
> I’m a big fan of the concept, have actually need one of these several
> times, and would like to see it moved to qtbase and made public
Makes sense to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190523/43956f07/attachment.html>
More information about the Development
mailing list