Friend function: Difference between revisions

Content deleted Content added
Revert to revision 743580274 dated 2016-10-10 08:03:16 by Acasson using popups
No edit summary
Tags: Mobile edit Mobile web edit
Line 5:
A friend function is declared by the class that is granting access, so friend functions are part of the class interface, like methods. Friend functions allow alternative syntax to use objects, for instance <code>f(x)</code> instead of <code>x.f()</code>, or <code>g(x,y)</code> instead of <code>x.g(y)</code>. Friend functions have the same implications on [[separation of concerns|encapsulation]] as methods.
 
A similar concept is that of [[friend class]].
Merits and demerits of using friend function
 
==Use cases==