0

I know this topic might not be useful. This question can across in my mind when I was implementing friend function. In operator overloading of post-increment member function we need to write int as argument (for the sake of differentiating it from pre-increment though we don't have to pass anything) so How de we implement friend return_type operator_post-increment()?

Priyansh
  • 31
  • 5
  • Same as any other member/friend overloaded operator. The member function has an implicit `this` first parameter. In the friend function you need to explicitly pass the type that `this` would have been. https://stackoverflow.com/questions/4622330/operator-overloading-member-function-vs-non-member-function – JohnFilleau Apr 13 '20 at 14:48
  • Better link here. https://en.cppreference.com/w/cpp/language/operator_incdec – JohnFilleau Apr 13 '20 at 14:58

0 Answers0