Can 2 classes share a friend function?

后端 未结 4 785
轻奢々
轻奢々 2021-01-12 12:05

Today i have a doubt regarding friend function. Can two classes have same friend function? Say example friend void f1(); declared in class A and class B. Is t

4条回答
  •  既然无缘
    2021-01-12 12:57

    There is no restriction on what function can or cannot be friends's of class's, so yes there's no problem with this.

提交回复
热议问题