Derive from interface

Michelle Long HappyDance321 at gmail.com
Mon Mar 25 21:38:51 UTC 2019


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, this is impossible)











More information about the Digitalmars-d-learn mailing list