我得到一些编译时错误,我不明白为什么会这样。以下代码将拒绝编译,给我以下错误:
错误 C2664: 'void (PyObject *,const char *,boost::type *)' : 无法将参数 1 从 'const char *' 转换为 'PyObject *'
错误 C2664: 'void (PyObject *,const char *,boost ::type *)' : 无法将参数 3 从 'boost::shared_ptr' 转换为 'boost::type *'
PyObject* self = ...;
const char* fname = "...";
boost::function<void (boost::shared_ptr<Event>)> func;
func = boost::bind(boost::python::call_method<void>, self, fname, _1);