Overloaded Unary Operator ++
I have a question that I can't seem to find an answer for, and I am wondering if someone here might be able to lend me some knowledge.
I am curious as to how the computer knows which member function to call, post or pre-increment, when operator notation is used in the main program. I can understand how it would be know using function notation, such as the following:
obj1.operator++(); // Pre-increment call
obj1.operator++(0); // Post-increment call
But how does it know which one to call if this was the code:
++obj1; // Pre-increment call
obj1++; // Post-increment call
Please reference the following test code:
Test(signed short int = 0);
signed short int var;
Test::Test(signed short int tvar)
var = tvar;
void Test::operator++(int x)
signed int main()
Edit: Fixed object name mismatch - didn't change the point of the post, however - just nitpicky on my part.