templated functions and derivation
Hello
I have a derived and base class.
From derived class I call templated functions in base class.
For instance:
Code:
class base {
public:
base() { }
template <typename T>
void somefunction(T t) {
callback(t);
}
template <typename T> // I want to make it templated to call derived back with templated argument
virtual void callback(T t) = 0;
}
class derived : public base {
public:
derived() { }
void callsomefunction() {
sometype someinst;
somefunction(someinst);
}
void callback(sometype t) {
}
}
Now I want to callsomefunction() from derived class.
How could I callback (virtual function) from base class with templated argument as you can see in the code?
How could this be possible?
Do I have to make templated base class?