C++ edit

friend keyword

Well-designed classes encapsulate their functionality, hiding their implementation while providing a clean, documented interface. This allows redesign or change so long as the interface is unchanged.

In a more complex scenario, multiple classes that rely on each others’ implementation details may be required. Friend classes and functions allow these peers access to each others’ details, without compromising the encapsulation and information hiding of the documented interface.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Table Of Contents
14 friend keyword
63 RAII
85 RTTI
  ↑ ↓ to navigate     ↵ to select     Esc to close