[Qt-interest] Qt Containers (or: why I must use STL)
David Forstenlechner
dforsten at newtek.com
Tue Oct 13 08:51:13 CEST 2009
Honestly,
I would not even think about using the Qt containers unless I must.
Every C++ programmer should be familiar with STL containers,
there are lots of great books and documentation on how to use them,
and the STL implementations are reasonably stable at this point.
When you got special needs you may have to write your own data
structures anyways,
I see the Qt data structures mainly as a support for the Qt GUI framework,
not as general purpose replacements for STL/boost or custom written
special-purpose ones.
- DavidF
Yves Bailly schrieb:
> Thiago Macieira a écrit :
>> Em Segunda-feira 12. Outubro 2009, às 23.36.43, Stephen Bryant escreveu:
>>> Actually, it's worse than that: the reserve() and resize() methods
>>> take a signed int. Signed? That's just plain silly!
>>> On x86_64, int is still only 4 bytes, so despite masses
>>> of memory, I can never have a byte array larger than 2GB.
>> You mean 2 billion elements. In a QList, that's at least 16 GB of memory, for
>> the array alone.
>
> Just for the record... QList is a poor choice when managing huge amount of
> items (horrible perfomance, overhead), so I assume Stephen was refering to
> QVector. And for your information, I personnaly currently develop on a
> machine having 20GB of RAM (yes, RAM) and I have already seen the need to
> hold about 2500000000 items.
>
> Yes, web browsers, database explorers and funny toys are not the only apps
> that can be worked on by Qt users, there are also highly scientific or
> industrial ones. See milling for example.
>
> So I personaly agree with what Stephen wrote.
>
> Regards,
>
More information about the Qt-interest-old
mailing list