friend keyword:
friend keyword
suggest changeWell-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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents
11Loops
13friend keyword
14keywords
17Pointers
26std::map
29std::any
38File I/O
39Streams
51Unions
56Lambdas
60SFINAE
62RAII
67Sorting
84RTTI
87Scopes
102Attributes
104Profiling
107Recursion
113Header files
117Iteration
125Alignment
133Optimization
134Semaphore
136Debugging
139Mutexes
141Unit testing
142decltype
146Contributors