[Interest] Qt container size()

Tomasz Siekierda sierdzio at gmail.com
Thu Jan 29 14:36:48 CET 2015


On 29 January 2015 at 14:32, Felix morack <felixover at gmail.com> wrote:
> Hi,
>
>
> Qt containers use 'int' to refer to their size thus limiting their size to
> INT_MAX.
>
> Is there any reason for this? Why dont they use size_t like the STL and the
> rest of the world?

Basically this is so that -1 can be used as error (see
QList::indexOf() and similar methods). I know this argument is not
very convincing, but there you go.



More information about the Interest mailing list