MTSL/h/member_template.h

22 lines
449 B
C++

//
// Created by dongl on 22-9-29.
//
#ifndef MSTL_MEMBER_TEMPLATE_H
#define MSTL_MEMBER_TEMPLATE_H
#endif //MSTL_MEMBER_TEMPLATE_H
/// 成员模板
template<class T1, class T2>
struct pair{
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){}
};