I\'m trying to create a map of string and method in C++, but I don\'t know how to do it. I would like to do something like that (pseudocode):
map
//pick one typedef float (*func_type_1)(float); typedef boost::function func_type_2; std::map fm; fm["sin"] = &Math::sin; fm["cos"] = &Math::cos; auto f = fm[str]; result = f(42);