How would the differences in these two operators cause them to be called differently? |
This is an admitted oddity in C++.
The problem was to figure out how to specify the postfix operator differently from the prefix operator. One rule that could not be broken to accommodate the situation is the simple fact that functions can't be overloaded by a difference in the return type only.
Keep that in mind for a moment.
The primary difference between the prefix and postfix operators, outside of the fact that postfix happens after an evaluation of the operand, is the fact that the postfix returns a copy, and in particular a copy of the state before the increment was performed. The prefix version merely returns the operand itself (in this case, a reference to it) after the increment is performed.
The awkward solution to the problem that overloading for this difference can't be merely by the return value, it was decided, arbitrarily (after much consternation in discussion I'm sure) that the postfix version would require an unused (and otherwise unnecessary) integer parameter. The compiler merely recognizes this as the postfix version as a matter of convention.
That last sentence is actually the answer here. It is an arbitrary choice deliberately causing the compiler to recognize that form as the postfix operator, and calls it in that circumstance, while the other version is the prefix version.
In discussion I've heard naive students inquire, "why can't we just define the postfix operator as"
v operator ()++ {...}
Yet, that would actually suggest the operator being defined is the function operator "()", which already has it's own validity, but with the apparent syntax error of the following "++".
Actually, that would not be all that bad a solution if it were accepted as an arbitrary interpretation of this one context for these operators (this all applies to '--' too), but alas, it appears the committee (if it was a committee at the time) simply didn't want to take that direction.