我正在尝试在一个类中制作一个函数指针表。我无法在网上找到任何这样的例子,大多数都涉及在他们的类之外使用成员函数指针。
例如:
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;
给我错误“术语不评估为采用 0 个参数的函数”。