I need a class to have a const std::map
from string to pointer to a function. How can I initialize this map without adding elements like this:
string func1(string a){
return a;
}
string func2(string x){
return "This is a random string";
}
//In class declaration:
const map<string,string(*)(string)> a;
//Where should this go? Any other, probably better method to initialize this map?
a["GET"] = &func1;
a["SET"] = &func2;
EDIT:
I am doing this on pre-C++11