继承中类模板的使用
1. 父类一般类,子类是模板类,和普通的用法类似
#include <iostream>
#include <Windows.h>
using namespace std;
//父类是一般类
class Father {
public:
Father(int age) {
this->age = age; }
int getAge() const {
return age; }
private:
int age;
};
template <typename T>
//子类是模板类
class Son : public Father {
public:
Son(T age) : Father