[Development] QList for Qt 6

Allan Sandfeld Jensen kde at carewolf.com
Wed May 22 21:36:39 CEST 2019


On Mittwoch, 22. Mai 2019 20:18:55 CEST Giuseppe D'Angelo via Development 
wrote:
> Il 22/05/19 20:14, Konstantin Tokarev ha scritto:
> >>>   FWIW, std::deque is implemented as a peculiar data strucutre which is
> >>>  not really contiguous, and it may perform worse than QList in certain
> >>>  cases>> 
> >> [citation needed], as usual.
> > 
> > https://en.cppreference.com/w/cpp/container/deque
> > 
> > "As opposed to std::vector, the elements of a deque are not stored
> > contiguously: typical implementations use a sequence of individually
> > allocated fixed-size arrays, with additional bookkeeping, which means
> > indexed access to deque must perform two pointer dereferences, compared
> > to vector's indexed access which performs only one."
> Sure, but the question was about usage of a std::deque vs QList for fast
> prepending behavior, not for indexed access. 

Maybe check for any place using QQueue, which is derived from QList, and meant 
for that exact usage. Or are you arguing that no one uses that, or that noone 
should be using it?

Allan





More information about the Development mailing list