I am having a pointer to the common static method
class MyClass
{
private:
static double ( *pfunction ) ( const Object *, const Object *);
...
};
<
In the second case, getA
is not a function anymore but a function template, and you can't have a pointer to function template.
What you can do is have pfunction
point to a particular getA
instance (ie: for T = int
) :
class MyClass
{
static double (*pfunction)(const Object *, const Object *);
};
double (*MyClass::pfunction)(const Object *o1, const Object *o2) = &SomeClass::getA;
But I don't think there is a way to get pfunction
to point on any possible instance of getA
.