I have a problem, I think it is very specific.
I have 2 classes, a B aseclass and D class (from B aseclass).
B is a template template (or class template) and has a clean virtual method. virtual void work(const T &dummy) = 0;
It is expected that class D , which must be reimplemented, but since D is derived from B , not D , is another template class, the compiler spits on me that virtual functions and templates do not work right away.
Any ideas how to accomplish what I want?
I am grateful for any thoughts and ideas, especially if you all have already developed this problem.
this class is fixed as AS IS, I cannot edit it without violating the existing code base
template <typename T>
class B {
public:
...
virtual void work(const T &dummy) = 0;
..
};
take int * as an example
class D : public B<int*>{
...
virtual void work(const int* &dummy){ }
..
};
Edit: the compiler tells me that it void B<T>::work(const T&) [with T = int*]is purely virtual within D
source
share