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

Julien Cugnière julien.cugniere at gmail.com
Tue Oct 13 11:06:22 CEST 2009


2009/10/13 Thiago Macieira <thiago at kde.org>
> 1) use of "int" doesn't mean limitation to 2 GB. It limits to 2 billion
> elements, which on a QList of small, movable items means 16 GB.

I'm curious how you get that 16 GB number. It was my understanding
that if T is a small movable type, then a QList<T> is just an array of
T.  So 2 billion elements would only mean sizeof(T) * 2 billion, just
like a QVector. With sizeof(T) == 4, that's only 8 GB. Are you
assuming sizeof(T) == 8, or is there something else ?

--
Julien Cugnière




More information about the Qt-interest-old mailing list