How Non-Member Functions Improve Encapsulation

后端 未结 8 983
心在旅途
心在旅途 2020-11-29 08:47

I read Scott Meyers\' article on the subject and quite confused about what he is talking about. I have 3 questions here.

Question 1

To expl

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 09:16

    He specifically says "non-member non-friend functions" (emphasis mine). If you would need to make the non-member function a fiend his algorithms says it should be a member function unless it's operator>> or operator<< or needs type conversions on its left-most argument.

提交回复
热议问题