#include<iostream>
#include<string>
using namespace std;
template<typename T>
void exchange(T& a,T& b)
{
	T temp=a;
	a=b;
	b=temp;
}

int main()
{
	int ix=11,iy=33;
	double dx=2.4,dy=6.8;
	string s1="previous",s2="later";
	cout<<"after swap:"<<endl;
	exchange(ix,iy);
	exchange(dx,dy);
	exchange(s1,s2);
	cout<<"ix="<<ix<<" "<<"iy="<<iy<<endl;
	cout<<"dx="<<dx<<" "<<"dy="<<dy<<endl;
	cout<<"s1="<<s1<<" "<<"s2="<<s2<<endl;
	return 0;
}