abstract template class

Consider this code:
1
2
3
4
5
6
template <class TYPE>
class base{
public:
TYPE in;
void func()=0;
};

I want to create a derived class of base class, whose TYPE is int. Is this possible ?
So the derived class shouldn't be a template class anymore.I hope you understand my question...
Something like this:

1
2
3
4
5
6
7
8
9
class deriv:public base<int>{
public:
void func(){}
};

//...

deriv obj;
obj.func();


Did you try to compile it?

Note that func needs to be declared as virtual.
 
virtual void func()=0;


Topic archived. No new replies allowed.