If I have two classes like this :
class A
{
public:
int *(*fun)( const int &t );
A( int *( *f )( const int &t ) ) : fun( f ) {}
};
So what to do
Not much. Other than templating A
on the type of objects for which it will hold a pointer to a member function taking a reference to a const int and returning a pointer to int.
What you're trying to do is to mix a pointer to a free function with a pointer to member function. Whilst it sounds like they're both function pointers they're different enough to not be able to pass through the same type definition.