Mail Archives: djgpp/1997/04/09/14:28:31
Alaric B. Williams wrote:-
> operator++(int) is postfix
> operator++() is prefix
> The ugliest syntax hack ever to see the light of day :-(
Chris Croughton <crough45 AT amc DOT de> replied:-
> Not quite, I think, but close. However, it's certainly one of the most
> counter-intuitive ones - the first looks prefix, with the parameter after
> the operator, and the second looks postfix with the variable obviously
> before (as in x.operator++()).
It seems clear to me.
operator++() is monadic prefix, same as e.g. operator*() is prefix: `++X'
operator++(int) is dyadic with a null 2nd arg, e.g. `X ++ <null>' == `X++'
- Raw text -