template<typename T>
class nodAB : public arbBinar<T>
{
private:
T info;
nodAB<T> *tata;
nodAB<T> *st;
nodAB<T> *dr;
public:
nodAB(const T& x):info(x),tata(0),st(0),dr(0){};
nodAB(const T& x, nodAB<T> *t):info(x),tata(t),st(0),dr(0){};
virtual nodAB<T>* copiaza();
virtual nodAB<T>*insereaza (T& item);
virtual void parcurge_invers();
void setInfo(T& x) {info =x;}
void setTata(nodAB<T> *t) {tata=t;}
void setStang(nodAB<T> *stang) {st=stang;}
void setDrept(nodAB<T> *drept) {dr=drept;}
T getInfo() const {return info;}
nodAB<T> *getStang() const {return st;}
nodAB<T> *getDrept() const {return dr;}
nodAB<T> *getTata() const {return tata;}
bool esteRadacina()const
{
return tata==NULL;
}
bool esteFrunza()const
{
return (st==NULL && dr==NULL);
}
bool esteFiuStang()const
{
return tata!=NULL && tata->getStang()==this;
}
bool esteFiuDrept()const
{
return tata!=NULL && tata->getDrept()==this;
}
~nodAB();
};
我的问题是为什么class nodAB: public arbBinar<T> {
Visual Studio 会给我一个语法错误?
template<typename T>
class arbBinar{
protected:
nodAB<T> *radacina;
public:
arbBinar():radacina(0){}
arbBinar(nodAB<T> *rad) {radacina=rad;}
nodAB<T> *getRadacina(){return radacina;}
~arbBinar();
};