
2 Jun
2006
2 Jun
'06
1:31 a.m.
Sebastian Redl wrote:
No, that's not true. (See Scott Meyers, Effective C++, Item 35) If a signed integer IS-A unsigned integer, then all invariants of unsigned integer must hold true for signed integer - including the one about negative values. ("There's no such thing.")
If this type is meant to have an invariant "about negative values", then perhaps it shouldn't be called UNsigned_integer (i.e. lacking the quality of sign)? Perhaps a better name would be nonnegative_integer. I think I'll ask the waiter if he can unsweeten my tea . . . on second thought, maybe I'd better not. - Marsh