Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   simple template class inheritance (http://www.go4expert.com/forums/simple-template-class-inheritance-t13307/)

arkangel 27Aug2008 03:39

simple template class inheritance
 
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 4Sep2008 11:07

Re: simple template class inheritance
 
Please just do not bump the threads.


All times are GMT +5.5. The time now is 02:41.