Use the title <functional>and class of the template std::function. This allows you to specify function objects with a fixed method signature.
std::map< unsigned int, std::function<int(int,int)> > callbackMap;
Assuming you index callbacks with unsigned int, the above map stores functions that take two intand return int.
source
share