#include <iostream>
#include<map>
#include<string>
#include<vector>
class Chip8{
private:
using type = void (Chip8::*)();
static type table[16]; //function pointer table
public:
void cycle();
void opcode0();
};
Chip8::type Chip8::table[16] = {
&Chip8::opcode0,
};
void Chip8::opcode0()
{
std::cout<<"opcode0 called"<<std::endl;
}
void Chip8::cycle(){
std::cout<<"cycle called"<<std::endl;
(this->*table[0])();
}
int main()
{
Chip8 chip;
chip.cycle();
return 0;
}