Inheritance of purity

Timon Gehr timon.gehr at gmx.ch
Fri Feb 17 05:47:27 PST 2012


On 02/17/2012 02:33 PM, Timon Gehr wrote:
>
> Introducing a new overload against const in a subclass is illegal:
>
> class C{
>      void foo(){}
> }
> class D : C{
>      override void foo(){}
>      override void foo()const{}
> }
>
> Error: D.foo multiple overrides of same function

Oops...

I meant

class C{
     void foo(){}
}

class D:C{
     override void foo(){}
     void foo()const{}
}

The error message is the same though.


More information about the Digitalmars-d mailing list