求教大佬们一个问题, 一个函数, 来自 libevent, 原型是这样
int evhttp_set_cb(struct evhttp *http, const char *path,
void (*cb)(struct evhttp_request *, void *), void *cb_arg);
我自己的函数做了封装, 为啥 cb 这个参数, 传进去就报错呢, 如果传入 nullptr 就没问题
void f(const std::string &path, void (*cb)(struct evhttp_request *, void *)) {
evhttp_set_cb(EventHttp, path.c_str(), cb, nullptr);
}