object oriented value type

BCS ao at pathlink.com
Thu Jul 12 17:15:22 PDT 2007


Reply to Reiner,

> I'm not sure what's wrong with genuine struct inheritance -- but not
> for polymorphism, just for code reuse. This would just be syntactic
> sugar for template mixins. Instead of:
> 

This would even act more or less as expected if everything is implicitly 
un overrideable.

Cast to base type, OK (and implicit).
Cast to derived type, Do at your own risk (no null on bad cast).

> 
> And primitive types work naturally as structs, so inheriting from them
> is fine as well.

OOhhhh.  Cool. <g>

> 
> -- Reiner
> 





More information about the Digitalmars-d mailing list