class bar { private: void barMe(); }; class foo { private: void fooMe(); friend bar; };
In the above example, the class foo cannot call barMe (). You must define the classes so that each other is mutual:
class foo; // forward class bar { private: void barMe(); friend foo; }; class foo { private: void fooMe(); friend bar; };
Shay erlichmen
source share