[Interest] Qt container size()

Felix morack felixover at gmail.com
Thu Jan 29 14:41:47 CET 2015


you can always use -1 as an error - even if signedness was an issue there
is still qint64.

2015-01-29 14:36 GMT+01:00 Tomasz Siekierda <sierdzio at gmail.com>:

> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150129/87391065/attachment.html>


More information about the Interest mailing list