// File: swap.cc
// Demo of template functions

#include <iostream>
#include <fstream>
using namespace std;

template < class T >
void swap( T& x, T& y );
template < class T >
void output( ostream& out, T x, T y );
int main() {
    int n = 10, m = 15;
    swap( n, m );
    output( cout, n, m );

    float a = 1.9, b = 1.1;
    swap( a, b );
    output( cout, a, b );
}

template < class T >
void swap( T& x, T& y ) {

   T temp;
   temp = x;
   x = y;
   y = temp;

}

template < class T >
void output( ostream& outfile, T x, T y ) {
   outfile << x << "  " << y << endl;
}
