static member and/or @property ?

chmike via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 19 08:42:48 PDT 2016


On Thursday, 19 May 2016 at 15:33:21 UTC, ag0aep6g wrote:
> . . .
> interface AThing
> {
>     final string name() { return nameImpl(); }
>     string nameImpl();
> }
>
> class OneThing : AThing
> {
>     static string name() { return "OneThing"; }
>     override string nameImpl() { return name(); }
> }
>
> class OtherThing : AThing
> {
>     static string name() { return "OtherThing"; }
>     override string nameImpl() { return name(); }
> }

This is what I was looking fer. Thank you very much.

The fact that I used the class name is just a coincidence for 
making the example clear.



More information about the Digitalmars-d-learn mailing list