KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 the following compile error: error: template declaration of : T (* pfunction )(const Object <T> *o1, const Object <T> *o2) Thanks for your help...
Tags (comma-separated)
Save Edits
Cancel