template<class T> swap(T& a, T& b) // "old style swap" { T tmp(a); // now we have two copies of a a = b; // now we have two copies of b b = tmp; // now we have two copies of tmp (aka a) } 如果T是一个复制元素要付出昂贵代价的类型,比如string和vector,swap将会变成...