On Thu, May 23, 2019 at 12:15 PM Shawn Rutledge <shawn.rutle...@qt.io> wrote:
> > On 23 May 2019, at 07:51, Konstantin Shegunov <kshegu...@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.
_______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development