diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 504e0a9b..cba219c0 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -306,7 +306,7 @@ protected: rec->def = new PyMethodDef(); std::memset(rec->def, 0, sizeof(PyMethodDef)); rec->def->ml_name = rec->name; - rec->def->ml_meth = reinterpret_cast(*dispatcher); + rec->def->ml_meth = reinterpret_cast(reinterpret_cast(*dispatcher)); rec->def->ml_flags = METH_VARARGS | METH_KEYWORDS; capsule rec_capsule(rec, [](void *ptr) {