c++ std::map of heterogeneous function pointers
问题 Is it possible to store pointers to various heterogenous functions like: In the header: int functionA (int param1); void functionB (void); Basically this would the part I don't know how to write: typedef ??boost::function<void(void)>?? functionPointer; And afterwards: map<char*,functionPointer> _myMap; In the .cpp void CreateFunctionMap() { _myMap["functionA"] = &functionA; _myMap["functionB"] = &functionB; ... } And then reuse it like: void execute(int argc, char* argv[]) { if(argc>1){ int