TITLE: When implicit type conversions gives unpleasant results (This comes from "Programming in C++" by Henricson and Nyquist, example 51.) Example 51 When implicit type conversions gives unpleasant results // This function looks bulletproof, but it isn't. // Newer versions of compilers should flag this as an error. void mySwap (int& x, int& y) { int temp = x; x = y; y = temp; } int i = 10; unsigned int ui = 20; mySwap (i, ui); // What really happens here is: // int T = int (ui); implicit conversion // mySwap (i, T); ui is of course not changed // fortunately, the compiler warns for this !