Is there any difference if we define friend function inside or outside of class

前端 未结 6 1310
借酒劲吻你
借酒劲吻你 2020-12-10 16:09

What is the difference between defining friend function inside the class or declaring inside and define outside of the class. Also why it is possible to place definition ins

6条回答
  •  清歌不尽
    2020-12-10 16:36

    Friend functions defined inside the class can only be looked up through ADL when called from outside the class. Functions defined outside of the class can be found even without ADL.

提交回复
热议问题