[Development] QList for Qt 6

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Wed May 22 20:18:55 CEST 2019


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. Sticking to the same 
reference, it _also_ points out that appending at either extremity of 
std::deque is O(1) (vs. O(n) for QList). So, again, [citation needed].

Thanks,
-- 
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 --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190522/a10a44bd/attachment.bin>


More information about the Development mailing list