template derived class

Jan 18, 2011 at 2:30pm
if i want to define a derived class from a template base the way i know is
1
2
3
4
5
6
7
template<class x> class Base {
    
};
class derived:public Base<int>
{

};


but if also derived is template with same class x how can we do that??
Jan 18, 2011 at 2:34pm
ok found it
1
2
3
4
template<class x> class derived:public Base<x>
{

};
Jan 18, 2011 at 2:36pm
but if also derived is template with same class x how can we do that??
I don't quite understand what you mean. Maybe that?

1
2
3
4
template<class x> class derived:public Base<x>
{

};


EDIT: 2 min
Last edited on Jan 18, 2011 at 2:37pm
Topic archived. No new replies allowed.