'final' function implementations in interface definition

HOSOKAWA Kenchi hskwk at inter7.jp
Sun Jun 7 15:35:18 PDT 2009


Robert Clipsham Wrote:

> If you want this then you need abstract classes. 
> http://www.digitalmars.com/d/1.0/attribute.html#abstract
> 
> abstract class A
> {
>    abstract void f(int);
>    final void f_twice(int i) { f(i); f(i); }
> }
> 
> class B : A { }
> 
> (new B).f_twice(1);

Unfortunately the derived class have already inherited another class in my code.
I need interface inheritance.




More information about the Digitalmars-d mailing list