aliasing base methods

Frank Benoit (keinfarbton) benoit at tionex.removethispart.de
Sun Feb 25 09:54:44 PST 2007


> 
> class Base
> {
>    int foo(int) { ... }
> }
> class Derived : Base
> {
>    // Is this "error: override keyword required"
>    // Or is it ok -- not an override but a distict overload leaving
>    // foo(int) in tact.
>    int foo(float) { ... }
> }
> 

In this case it would compile without error. You did not provide
'override', so you say: make overload.

If 'override' is required, it would be obvious, that it is missing. So I
think it would be much easier to find this error (if override was
meant). And it is documented for a later reader. This is an improvement
of readability.





More information about the Digitalmars-d mailing list