Method overloading and inheritance

Mike L. sgtmuffles at myrealbox.com
Fri Jul 3 18:36:01 PDT 2009


So currently if you want to overload just one case of an overloaded function, you have to use an alias for the class to keep the behavior of the other cases. I talked about it a little in #d, and the only reason that was given was that it might protect the programmer somehow. But why should the default behavior cause a sub-classto no longer behave like the class that it extends? Not to sound like a Java fanboy (I'm not, it's just the only other language I'm able try it out on right now), but it doesn't require anything like that, and behaves how I would consider intuitively. Isn't function overloading just re-using a name? Why is that reason to treat things differently when they're inherited? Thanks.



More information about the Digitalmars-d mailing list