[Qt-interest] Qt Containers (or: why I must use STL)

Thomas Fjellstrom tfjellstrom at shaw.ca
Tue Oct 13 10:42:20 CEST 2009


On Tue October 13 2009, David Forstenlechner wrote:
> 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.

Your view. I happen to seriously dislike the STL in every way. boost is just a 
bloatier version. Still doesn't have decent string class afaik.

> - 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,
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 


-- 
Thomas Fjellstrom
tfjellstrom at shaw.ca




More information about the Qt-interest-old mailing list