Using boost::bind() across C code, will it work?
问题 Can I use boost::bind(mycallback, this, _1, _2) across C code? Update The short answer is no , boost bind does not return a function pointer, which can be called in C code, but a functor (C++ object with overloaded () operator) see answer below. 回答1: The best way to do what you want to do is to create a C callback that then calls the boost::function, which is stored in some sort of user memory with new. Example: void callFunction(void* data) { boost::function<void(void)> *func = (boost: