operator overloading in C++, member function vs non-member function which one is better?

后端 未结 0 501
名媛妹妹
名媛妹妹 2021-01-03 17:27

We can overload "+" operator in 2 ways. one way is using member function, another way is using non-member function. for example:

struct X {

  // me         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题