Friend function: Difference between revisions

Content deleted Content added
m Reverting possible vandalism by 14.139.241.203 to version by 117.234.215.250. Report False Positive? Thanks, ClueBot NG. (3700710) (Bot)
Collapse constant member assignments to use C++11 in-class member variable assignment, to simplify examples a little
Line 19:
class Bar {
private:
int a = 0;
public:
Bar(): a(0) {}
void show(Bar& x, Foo& y);
friend void show(Bar& x, Foo& y); // declaration of global friend
Line 28 ⟶ 27:
class Foo {
private:
int b = 6;
public:
Foo(): b(6) {}
friend void show(Bar& x, Foo& y); // declaration of global friend
friend void Bar::show(Bar& x, Foo& y); // declaration of friend from other class