Private visible?
Jari-Matti Mäkelä
jmjmak at utu.fi.invalid
Fri Jul 14 10:23:07 PDT 2006
xs0 wrote:
>>> As for overloading issues, as far as I am concerned, feel free to
>>> require all methods with the same name to have the same protection;
>>> anything else is poor taste anyway.
>>
>> Really? Then how do you hide the previous method implementation?
>
> I'm not sure what you're asking here.. You can override methods as
> normal. You can also increase visibility, if you want, but once you do
> it for one method named "foo", you have to do it for all other methods
> named "foo" as well.
Sorry, my bad. I was still thinking about the overrides.
Combining overriding + overloading may lead to very confusing code.
Personally I definitely wouldn't want to touch any C++ code that
overloads ints, longs and/or chars and overrides them with methods
having totally random visibility unless somebody was pointing at me with
a loaded shotgun.
Luckily overloading is a bit easier in D. Still, it should first check
that all overrides are sane and nothing weird happens when an object is
called through different base classes/interfaces.
--
Jari-Matti
More information about the Digitalmars-d
mailing list