
26 May
2006
26 May
'06
11:59 a.m.
On May 26, 2006, at 7:26 AM, Maarten Kronenburg wrote:
Every unsigned integer is an integer,
No. A (signed) integer will have a negation operator, such that 0 - x = - x, x + -x = 0, etc. An unsigned integer will not have this operator.
and every modular integer is an integer. So therefore in my opinion public inheritance can be used. Also I think there is no other way of defining an unsigned_integer.
Sure there is. What we want is to share nearly all of the implementation details without providing exactly the same interface. You can do that with a common base class (that is neither integer nor unsigned_integer). Doug