simple template class inheritance

arkangel's Avatar, Join Date: Aug 2008
Light Poster
Code:
template<class Z>
class A1{
protected :
	Z  u;

public:
	A1(Z pu):u(pu){}
	Z getU(){return u;}

};


template <class  Z>
class A2:public A1<Z>{

public:
	A2(Z pu):A1<Z>(pu){};
	Z nothing(){return u;}
};

In a normal class u is defined in this scope , but in a template is not . as protected shouldn't be visible within A2? what is wrong
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Please just do not bump the threads.