There is multiple class with different functions. For example:
class A
{
public:
int sum(int a, int b);
bool isScalable(double d);
}
class B
{
public:
std:string ownerName();
}
My aim is to create a map of all the function names as below
std::map<std::string, FnPtr> myMap;
// Add the newly implemented function to this map
myMap["sum"] = &A::sum;
myMap["isScalable"] = &A::isScalable;
myMap["myMap"] = &B::myMap;
The issue is I am not aware how I can define FnPtr. Can you please help me out.
Aucun commentaire:
Enregistrer un commentaire