Specify a class member function as a friend of another class?

后端 未结 7 752
小蘑菇
小蘑菇 2020-12-08 21:43

According to the C++ Primer book, the author mentioned that We can specify a class member function as a friend of another class, instead of the entire class (page 634).

相关标签:
7条回答
  • 2020-12-08 22:23

    firstly forward declare class A, so that its visible in class B definition. then define class A containing a friend function from class B.

    0 讨论(0)
提交回复
热议问题