//成员模板就是模板中包含模板
template <class T1,class T2>
struct pair
{
typedef T1 first_type;
typedef T2 second_type;
T1 first;
T2 second;
pair()
:first(T1()),second(T2()){}
pair(const T1&a, const T2& b)
:first(a),second(b){}
template<class U1,class U2>
pair(const pair<u1,U2>&p)
:first(p.first),second(p.second){}
};
构造函数大量使用
成员模板函数必须 U1是T1子类 U2是T2子类中,必须与T1 ,T2中的成员相匹配