typedef void (classname::*funptr)(int);
void classname::func(int p)
{
...
}
void classname::someotherfunc()
{
........
funptr ptr;
ptr= &(classname::func); // this is error line
...........
}
它给了我以下错误:
error C2276: '&' : illegal operation on bound member function expression.
接下来我尝试了
ptr= classname::func;
这给出了这个错误:
error C3867: 'FaceBinUI::progress_update': function call missing argument list; use '&FaceBinUI::progress_update' to create a pointer to member
请为此问题提出一些解决方案。