On 2/23/2012 8:59 AM, Bruno Medeiros wrote:
I would even add to this that it might be useful to have similar syntax that
would allow to define an override method without having to specify the return
type nor the parameters of the overridden method. Sometimes in class hierarchies
there is a lot of redundancy when overriding methods and it could be a nice
small feature to reduce that (especially for methods with lots of parameters).

class Foo {
int num;

override opEquals {
if(cast(Foo) o is null)
return false;
return this.num == (cast(Foo) o).num;
}

override toString {
return to!(string)(num);
}

}


Not a bad idea, but it would be problematic if there were any overloads.

Reply via email to