Boost.Python function pointers as class constructor argument
问题 I have a C++ class that requires a function pointer in it's constructor ( float(*myfunction)(vector<float>*) ) I've already exposed some function pointers to Python. The ideal way to use this class is something like this: import mymodule mymodule.some_class(mymodule.some_function) So I tell Boost about this class like so: class_<SomeClass>("some_class", init<float(*)(vector<float>*)>); But I get: error: no matching function for call to 'register_shared_ptr1(Sample (*)(std::vector<double, std: