C++, function pointer to the template function pointer
- by Ian
I am having a pointer to the common static method
class MyClass
{
private:
static double ( *pfunction ) ( const Object *, const Object *);
...
};
pointing to the static method
class SomeClass
{
public:
static double getA ( const Object *o1, const Object *o2);
...
};
Initialization:
double ( *MyClass::pfunction ) ( const Object *o1, const Object *o2 ) = &SomeClass::getA;
I would like to convert this pointer to the static template function pointer:
template <class T>
static T ( *pfunction ) ( const Object <T> *, const Object <T> *); //Compile error
where:
class SomeClass
{
public:
template <class T>
static double getA ( const Object <T> *o1, const Object <T> *o2);
...
};
But there is some error... Thanks for your help...