Content deleted Content added
No edit summary Tags: Mobile edit Mobile web edit |
Removed unfinished sentence (quite surprised no one noticed this, it's been a month since the last 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==
|