Automatic method overriding in sub-classes

Daniel N via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 29 01:29:49 PDT 2015


On Thursday, 29 October 2015 at 08:27:04 UTC, Daniel N wrote:
> class Base(T) : IBase
> {
>    final string Name()
>    {
>        return typeof(this).stringof;
>    }
> }
>
> class One : Base!One { }
> class Two : Base!Two { }

Meh, sorry, ofcourse it should be:

return typeof(cast(T)this).stringof;



More information about the Digitalmars-d mailing list