Overloaded friend Functions

It’s possible to specify overloaded functions as friends of a class. Each function intended to be a friend must be explicitly declared in the class definition as a friend of the class.


Image Software Engineering Observation 9.12

Even though the prototypes for friend functions appear in the class definition, friends are not member functions.



Image Software Engineering Observation 9.13

Member access notions of private, protected and public are not relevant to friend declarations, so friend declarations can be placed anywhere in a class definition.



Image Good Programming Practice 9.4

Place all friendship declarations first inside the class definition’s body and do not precede them with any access specifier.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.169.109