我正在尝试在类中创建一个函数指针表.我无法在网上找到任何这样的例子,大多数都涉及在他们班级之外使用成员函数指针.
例如:
class Test
{
typedef void (Test::*FunctionType)();
FunctionType table[0x100];
void TestFunc()
{
}
void FillTable()
{
for(int i = 0; i < 0x100; i++)
table[i] = &Test::TestFunc;
}
void Execute(int which)
{
table[which]();
}
}test;
Run Code Online (Sandbox Code Playgroud)
给我错误"术语不评估为采用0参数的函数".