I have a class which interpolates a 2D function automatically (quite happy with it). It accepts a dynamic function pointer to the method being interpolated. I have had to template out the class, since I need the object instance as well as the pointer.
Can I avoid templating the class out? Or will I need to keep doing so in order to accept the object instance as a parameter? Is a base class possible? (I'm fairly new to c++)
The way I have it is (abbreviated):
template<class F>
class Interpolate {
Interpolate(double (F::*f)(double, double), F & obj, ...) {
...
double value = (object.*f)(x,y);
...
}
}