On 2009-02-09 07:34:44 -0500, Michel Fortin <[email protected]> said:

The only advantage you have is that your type can be derived from another so you can reuse some of its implementation. There are other ways to acheive that in D however (mixins come to mind).

That said, I'm not against adding struct inheritance if it can be done in a way that avoids slicing problems. I think this can be acheived by making slicing innoculous:

1. forbid overriding base members
2. forbid destructors in derived strucs (or else slicing would lose the destructor)

Open questions:
Is that constraining enough to avoid slicing problems?
Do these constrains make the feature irrelevant?

--
Michel Fortin
[email protected]
http://michelf.com/

Reply via email to