代码片段如下。无法理解为什么我会收到此错误。
void
SipObj::check_each_field()
{
map <std::string, sip_field_getter>::iterator msg;
string str;
char name[20];
bool res = false;
sscanf(get_payload(), "%s %*s", name);
LOGINFO(lc()) << "INVITE:" << name;
str = name;
msg = sip_field_map.find(str);
if (msg != sip_field_map.end()) {
sip_field_getter sip_field = msg->second;
res = (this).*sip_field();
}
}
typedef bool (SipObj::*sip_field_getter)();
static map <std::string, sip_field_getter> sip_field_map;
sip_field_getter
是函数名称的占位符