Struct Inheritance (not concept interfaces)

Christopher Wright dhasenan at gmail.com
Tue Mar 11 15:55:28 PDT 2008


Sclytrack wrote:
> With struct inheritance I mean the following and not the "concept interfaces".

If you're going to have any syntax for it, why not use the same syntax 
that you get with classes?

You'd have no polymorphism; the only benefits would be transparent 
aggregation and maybe `is (DerivedStruct : BaseStruct)` would return true.

However, you can get automatic aggregation with some (perhaps slightly 
tedious) template magic. I'm not interested in writing it, though, 
because it's tedious and fulfills no need for me.



More information about the Digitalmars-d mailing list