Quote:
Question 10.3
How can I write a generic macro to swap two values?
--------------------------------------------------------------------------------
There is no good answer to this question. If the values are integers, a well-known trick using exclusive-OR could perhaps be used, but it will not work for floating-point values or pointers, or if the two values are the same variable (and the "obvious" supercompressed implementation for integral types a^=b^=a^=b is illegal due to multiple side-effects).
[/EDIT]