NuTo
Numerics Tool
|
To quote Stroustrup (C++ Programming Language, 4.ed, p 73):
Using an
unsigned
instead of antint
[...] is almost never a good idea. Attemps to ensure that some values are positive by declaring variablesunsigned
will typically be defeated by the implicit conversion rules.
Scott Meyers agrees (obviously), and has written a short paper that better explains the pitfalls: "Signed and unsigned types in interfaces," C++ Report, September 1995.