const MyClass operator++(int); is a postfix increment operator prototype.
MyClass& operator++(void); is a prefix increment operator prototype.
This can be remembered by the fact that the postfix increment needs to return a temporary value, and not an lvalue to the original object. So, the function return const is the postfix.
Note: postfix, infix, and prefix refer to the location of operator with respect to the operand.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment