Postfix ++ operator overload

Is this some kind of coercive rule that a function overload ++should accept an argument intas a difference from prefix operators?

Also, in the case of a overload ++function prefix , how is the right operand an implicit argument?

For instance, ++ClassObj //ClassObj is rhs, but usualy lhs is made implicit

+3
source share
3 answers

On the second question. Both prefixes and postfix ++are unary operators, they do not have an operand of the left and right side, but only one operand on which they are applied. That is, in x++and ++x, xis an operand, not an right / left hand, but an operand.

, int, , ( ), , / ++, . , , .

+6

.. .

13.5.7 ,

, operator ++, prefix postfix ++. , , , prefix increment operator ++ . - ( int) ( int), postfix incrext operator ++ . ++, int .

+3

++ . , x++ ++x , x. ++ hack , int. , , ++ postfix.

+3
source

All Articles