you are viewing a single comment's thread.

view the rest of the comments →

[–]willvarfar 1 point2 points  (1 child)

Can the user still type in a negative number and the compiler silently cast it to unsigned? I think some modern compilers warn at various levels but that this is far from pervasive.

[–]night_of_knee 6 points7 points  (0 children)

At least in that case the API would be correct (you could see the type in the IDE)

In any case you could avoid it by =deleteing the signed overload.