// swap-template.cc
using namespace std;
#include <iostream>
#include <string>

template <class T>
inline void Swap(T& x, T& y) {
  T tmp = x;
  x = y; y = tmp;
}
template <class S>
ostream& out(string xx, S x, string yy, S y) {
  return cout<<xx<<" = "<<x<<", "<<yy<<" = "<<y;
}
int main() {
  int    x = 1, y = 2; float  u = 1.0, v = 0.4;
  double e = 2.7182818, pi = 3.14159265;
  out("x",x,"y",y)<<'\n';   Swap(x,y);  out("x",x,"y",y)<<'\n';
  out("u",u,"v",v)<<'\n';   Swap(u,v);  out("u",u,"v",v)<<'\n';
  out("e",e,"pi",pi)<<'\n'; Swap(e,pi); out("e",e,"pi",pi)<<'\n';
}
