basically i don't understand when and how to use it...
Thanks in advance,
basically i don't understand when and how to use it...
Thanks in advance,
What do you mean by "the hiding principle in inheritance"? Are you talking about abstraction and/or encapsulation (which is separate from inheritance), or are you talking about name hiding in inheritance?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
i'm talking about the name hiding
Personally, I have not encountered a case where it was useful. In Effective C++, 3rd Edition, Meyers discusses why name hiding exists:Originally Posted by sharon182
I assume that you are aware of how this problem can be solved by using a using declaration.The rationale behind this behavior is that it prevents you from accidentally inheriting overloads from distant base classes when you create a new derived class in a library or application framework. Unfortunately, you typically want to inherit the overloads. In fact, if you're using public inheritance and you don't inherit the overloads, you're violating the is-a relationship between base and derived classes that Item 32 explains is fundamental to public inheritance. That being the case, you'll almost always want to override C++'s default hiding of inherited names.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)