If you think you are using smart without using a third variable, do some performance testing and you will see that a much faster way is to use the 3rd int to store the variable temporarily.
In any case, I solved the problem with the bitwise XOR operator:
a ^= b; b ^= a; a ^= b;
source share