//File:  template.cpp
#include <iostream>
#include <string>
using namespace std;

template<class T> void swap (T &a, T &b)
{
	T temp = a;
	a = b;
	b = temp;
}

int main ()
{
	int x=12, y=5;
	
	string	s("HI"),
		t("THERE");
		
	cout	<<	"First number is: "	<<	x	<<	endl;
	cout	<<	"Second number is: "	<<	y	<<	endl;
	cout	<<	"First string is: "	<<	s	<<	endl;
	cout	<<	"Second string is: "	<<	t	<<	endl;
	
			//		in Visual C++ 6.0
	swap (x, y);	//<==	none of 2 overload have a best conversion
	swap (s, t);	//<==	ambiguous call to overloaded function
	cout << endl;
	
	cout	<<	"First number is: "	<<	x	<<	endl;
	cout	<<	"Second number is: "	<<	y	<<	endl;
	cout	<<	"First string is: "	<<	s	<<	endl;
	cout	<<	"Second string is: "	<<	t	<<	endl;

	return 0;
}	
