N
Nicolas Castagne
Hi all,
I have been wondering for a while why function hiding (in a derived
class) exists in C++, e.g. why when writing
class Base {
void foo( int ) {}
};
class Derived: public Base {
void foo( char const [] ) {}
};
the method Base::foo(int) is 'hiden' in the Derived class.
I know that **using** the "using" keyword get reed of function hiding.
But why does hiding itself should be necessary ?
Since I am currently revising my C++ basics, I would really appreciate
if someone could give a good reason / example for the existence of
function hiding, or give me a WWW pointer on this question.
Thx much in advance !
Nicolas
REFERENCES
C++ FAQ LITE / Marshall Cline :
http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.9
Unfortunately, this FAQ does not explain the Reason of the behavior...
A thread "reason for existance of function hiding" on a Forum :
http://www.thescripts.com/forum/thread460595.html
Unfortunately this thread does not give good reasons.
I have been wondering for a while why function hiding (in a derived
class) exists in C++, e.g. why when writing
class Base {
void foo( int ) {}
};
class Derived: public Base {
void foo( char const [] ) {}
};
the method Base::foo(int) is 'hiden' in the Derived class.
I know that **using** the "using" keyword get reed of function hiding.
But why does hiding itself should be necessary ?
Since I am currently revising my C++ basics, I would really appreciate
if someone could give a good reason / example for the existence of
function hiding, or give me a WWW pointer on this question.
Thx much in advance !
Nicolas
REFERENCES
C++ FAQ LITE / Marshall Cline :
http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.9
Unfortunately, this FAQ does not explain the Reason of the behavior...
A thread "reason for existance of function hiding" on a Forum :
http://www.thescripts.com/forum/thread460595.html
Unfortunately this thread does not give good reasons.