Possible duplicate:
Can a member function template be virtual?
In the base class, the my_func function my_func defined as virtual. However, in a derived class, I would like to have my_func as a template method. Is it possible?
This does not seem to be the case. I get an error "cannot select object of abstract type", which, I believe, is due to the fact that the compiler does not recognize the override of virtual my_func in the base class. Could this reveal a bad design?
Thank you very much.
UPDATE: Thanks for the answers. Some of you suggest that I should post some of the code, so here it is. In the base class:
virtual void Fill(EventInfo* info, EasyChain* tree, vector<Muon*>& muons, vector<Electron*>& electrons, vector<Jet*>& jets, LorentzM& met) = 0;
But in a derived class, I would like to have:
template<typename _Jet> void Fill(EventInfo* info, EasyChain* tree, vector<Muon*>& muons_in, vector<Electron*>& electrons_in, vector<_Jet>& jets_in, LorentzM& met){
From your answers, I understand that the solution to the problem is to define another function in the derived class:
void Fill(EventInfo* info, EasyChain* tree, vector<Muon*>& muons, vector<Electron*>& electrons, vector<Jet*>& jets, LorentzM& met){
but then this function and the template function are the same for the case of _Jet being Jet* , would this not be a problem?
Some of them suggested a design problem here, I think it's true, I will have to think about how to get around this.