[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ Blues.



On Sun, Apr 19, 1998 at 01:34:15PM +0100, Peter Breitling wrote:
> Is this really a compiler bug?
No, it's not. Reading the MSVC documentation I found:

"Class scope is strictly observed; therefore, a function declared in a base
class is not in the same scope as a function declared in a derived class. If
a function in a derived class is declared with the same name as a function in
the base class, the derived-class function hides the base-class function
instead of causing overloading."

So Class2:Meth() overrides both previous declarations of Meth in Class1.
I don't think this is one of the greatest "features" of C++, rather one of
the more irritating ones.

Jonas