By deafult in C++, the comma operator allows you to perform calculations where only an expression is expected:
6 7 8
int x = 3;
cout << (x += 2, x *= 4, x - 2) << endl;
cout << x << endl;
18
20
But how does the compiler know I want this behavior and not that I am passing parameters to a function? Furthermore, what happens when you use a class that has overloaded operator, ? Which comma does the compiler use?
Guess what? I get some crazy errors. Try it yourself. So, is there a way I can force this to work one way or the other based on what I want it to do? Or do I just have to do it the long way around?
By the way, this is only an experiment; I'm not actually going to try and use this code at all.
The link you posted is a 404, so I don't understand your response. Also, I meant for the code there to output the sum of Small and Tall, which should by then be 25. Hoever, because the addition and subtraction both return the class itself, it may think I am calling operator, !