I have the following problem: I am writing a simple chip8 emulator, and have a massive class of interpreter functions that I would like to access via opcodes as keys, such a
Use std::invoke from the header functional to execute it (C++17):
std::invoke
functional
test t; std::invoke(iter->second, t);
After all, you need to invoke it on an object. The method on its own cannot be executed.
If you don't have C++17 (IIRC):
test t; (t.*(iter->second))();