Friend function: Difference between revisions

Content deleted Content added
No edit summary
Tags: Mobile edit Mobile web edit
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]]..
 
==Use cases==