Re: Derive from interface

2019-03-25 Thread Daniel Kozak via Digitalmars-d-learn
It depends on what you want. But you can always use composition instead of inheritance for B. I have been using things like alias this, mixin and ufcs to achive multiple iheritence and it works ok for me. On Mon, Mar 25, 2019 at 10:40 PM Michelle Long via Digitalmars-d-learn < digitalmars-d-learn

Derive from interface

2019-03-25 Thread Michelle Long via Digitalmars-d-learn
Since D does not support multiple inheritance, is there any way to effectively achieve this? class A; class B; class C : A, interface!B; Then it is as if I have done class A; interface iB; class B : iB; class C : A, iB; But I can then do C c = new B; (but since I can't make B inherit iB