I have a rather unusual problem... we are tasked with mapping a series of hexadecimal values to function pointers. However, I want to be able to call the function with already predefined parameters. Here is a segment of code that I am trying to get to work:
map<short, void(*)(MyClass, MyClass)> mapping = create_map();
map<short, void(*)(MyClass, MyClass)> create_map()
{
map<short, void(*)(MyClass, MyClass)>> m;
m[1] = &function(new MyClass(), new MyClass());
return m;
}
However, it will only let me put function without parameters into the mapping. How do I store this setup and call it later?