I've read over the web that template virtual functions are not allowed , is it true ? It's a little bit weird since this code compile great on my Eclipse's g++
template <class T>
class A {
public:
virtual ~A<T>() { }
virtual void printMe() {cout << "I am A class" << endl;}
};
template <class T>
class B: public A<T> {
public:
void printMe() {cout << "I am B class" << endl;}
};
int main() {
A<int> * ptr = new B<int>;
ptr->printMe();
delete ptr;
return 0;
}
Regards,Ronen