让我们简单的实现swap函数,并将自定义的swap写成一个模板类
template<class T>//调用模板类 void swap(T& a, T& b)//取引用 { T tmp = a; a = b; b = tmp; }