I would like to know how to fill this type of map and mainly the way to access to the function pointer.
The map :
enum enum1
{
val11,
val12,
val13
};
enum enum2
{
val21,
val22,
val23
};
typedef void(MyClass::*funcPtr)();
std::map<std::pair<enum1, enum2>, funcPtr> map;
I fill it like this, it seems to work:
map.insert(std::make_pair(std::make_pair(val11, val21), &MyClass::init));
But I can't access to the function like this:
map[std::make_pair<val11, val21>]();
What am I doing wrong?