c++ - Size method of QVector and std::vector -
the size method of qvector
of type int
, same method in std::vector
unsigned
. why difference. isn't unsigned type right way hold size, since can't negative?
because they discussed in 1999 , got conclusion int
better choice, since number of functions returning uint
relatively small , displeased warnings:
subject: re: killing uint return type in qt. from: alex sandro queiroz e silva <asandro@xxxxxxxxxxxxx> date: wed, 17 mar 1999 15:29:37 -0300 (est) cc: qt-interest@xxxxxxxx to: arnt gulbrandsen <arnt@xxxxxxxx>
on 17 mar 1999, arnt gulbrandsen wrote:
about 0.15% of functions in qt return uint. of called qmumble::size() or qmumble::count(). these functions never need return negative number, really, uint right type them return.
but it's nuisance, me @ least. keep comparing them ints, putting them in variables -can- contain negative numbers, , on. i've written
if ( blah->count() < )
and gotten compiler warning many times already.
so considering changing return type these functions int in qt 2.0. think? you're users - want correctness , total backward compatibility or prefer more convenience?
--arnt
i think time convenience better, kind of results may methos, so...
-- alex asandro@lcg.dc.ufc.br
Comments
Post a Comment