Contact: aviboots(AT)netvision.net.il
41,502 questions
54,086 answers
573 users
#include <iostream> template<class T, class U> void swap(T &a, U &b) { T temp = a; a = b; b = temp; } int main() { int x = 10; long y = 25; swap(x, y); // swap<int, long>(x, y); std::cout << x << " " << y; } /* run: 25 10 */