类模板继承使用
template<class T>
class uBase {
public:
uBase(){}
~uBase(){}
public:
virtual void GocAData(T data) = 0;
};
template<class T>
class uChild : public uBase<T>{
public:
uChild() {}
~uChild(){}
public:
void GocAData(T data) {
cout << data << endl;
}
};
void testT()
{
uChild<int> uic;
uic.GocAData(123);
uChild<string> usc;
usc.GocAData("dsadqweqwe12");
}