在下面的代码中(请参阅评论):
#include "stdafx.h"
#include <iostream>
using std::cout;
struct Base
{
void fnc()
{
cout << "Base::fnc()";
}
};
struct Impl
{
void* data_;
Impl(void (Base::*fp)())
{
fp();//HERE I'M INVOKING IT - I'M DOING SOMETHING WRONG!
}
};
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
错误
“错误 1 错误 C2064:术语不计算为采用 0 个参数的函数”为什么它不起作用以及如何修复它?