// ftemp1.cpp: A function template for swapping the values 
// of two objects of a given, arbritrary type
#include <iostream>
using namespace std;

template <typename T>
void swapObjects(T &x, T &y) {
 T w = x;
 x = y;
 y = w;
}

int main() {
 int i = 1, j = 2;
 float u = 3.4F, v = 5.6F;
 cout << "Before swapping: " << " i = " 
 << i << " j = " << j << " u = " << u << " v = " << v << endl;
 swapObjects(i,j);
 swapObjects(u,v);
 cout << "After swapping: " << " i = " 
 << i << " j = " << j << " u = " << u << " v = " << v << endl;
 return 0;
} 

