I have a C++ class which contains the following definition:
class SomeClass:
public BaseClass
{
public:
SomeClass();
bool SomeClass::MyFunc( Json::Value& jsonRoot)
typedef bool(SomeClass::*PFUNC)(Json::Value&);
std::map<std::string, PFUNC> m_map;
}
later on in the c++ code i add values to the map variable using the following line:
SomeClass::SomeClass()
{
m_map["func"] = &SomeClass::MyFunc;
}
and for execution within one of SomeClass's methods:
std::map<std::string, PFUNC>::iterator itFunction = m_map.find("func");
if (itFunction != m_map.end())
{
PFUNC pfParse = m_map["func"];
Json::Value x;
this->*pfParse(x);
}
I end up getting the following compilation error:
error C2064: term does not evaluate to a function taking 1 arguments
I even tried using the iterator explicitly - this->*iterator->second(...) but ended up with the same error.
what am i doing wrong? thanks