A question for you all: size_t or unsigned int

Paul Harris paulharris at computer.org
Thu Nov 13 11:54:23 UTC 2008


To fix some warnings and potential 64 bit traps in libkdtree, I need to
choose between size_t and unsigned int.

For number of dimensions, I would assume that noone would ever get close to
a size_t maximum, or even an unsigned short max (65536 dimensions
anyone?)...  so it could be anything.

as for count_within_range() and things like that, in theory maybe it should
be size_t (eg std:list::size() returns a size_t) ?  or is everyone happy
with unsigned ints?

does anyone know what the "standard" policy is on this?  from what I can
tell, size_t will allow you to store the largest integer number on that
platform (eg max memory address etc) whereas unsigned int is the most
efficient integer size...

thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20081113/5d0396e8/attachment.htm 


More information about the libkdtree-devel mailing list