@Xc-liu
2018-08-29T22:15:13.000000Z
字数 412
阅读 686
c++
- class_name1.h
....
typename<typename T>
class class_name1{
public:
int date;
virtual void func1();
void func2(){
return 1;
}
....
}
....
- class_name2.h
....
include "class_name1.h"
typename<typename T>
class class_name1:public class_name1{
...
//fag wen访问基类数据成员的两种方式
int date2=this->date
int date3=class_name1<T>::date;
//覆盖虚函数
void func1(){...}
//访问基类成员函数的两种方式
this->func2();
class_name1<T>::func2();
...
}