robinsonZ 2015-09-24 01:10 采纳率: 50%
浏览 1904

C++ 函数指针问题 std::function

ypedef std::function DMCallback;
//用这个声明一个函数变量
void Ask(DMCallback *cb);
//参数为函数指针

现在需要把

int HelloWorld::test(int code,const char* msg, const rapidjson::Value &val)
{
return 1;
}

这个函数作为参数放进Ask函数里面,这要怎么做?

  • 写回答

2条回答 默认 最新

  • threenewbee 2015-09-24 01:21
    关注
     Ask(*HelloWorld::test)
    
    评论

报告相同问题?