advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
"The need to change a base class's interface might indicate a design flaw—either in the base class or in the derived class." Do you agree with this statement? Let us know in our C++ Developer Forum.
Partners & Affiliates
advertisement
advertisement
advertisement
Average Rating: 4.3/5 | Rate this item | 6 users have rated this item.
 

Modify Your Base Class Interface in Derived Classes

Though the base class exists to save you work, its little quirks can be tricky. What if you need to extend or alter its interface in a derived class? Or readjust a member's access? Learn how to use a using-declaration to control a member's access type and to overload member functions across a class hierarchy. 


advertisement
base class provides an interface that is inherited by derived classes. However, in some cases you need to extend, or even alter, the base class's interface in a derived class. For example, if you're overloading a member function of the base class in a derived class or readjusting a member's access.


How do you overload a member function across a class hierarchy? How do you override the access type of a base class's member in a derived class?


Use a using-declaration to control a member's access type and to overload member functions across a class hierarchy.

  Next Page: Demonstrating the Problem
Page 1: IntroductionPage 3: Name Injection
Page 2: Demonstrating the ProblemPage 4: Controlling Access Type
Please rate this item (5=best)
 1  2  3  4  5
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs