Ive been working with Python and C++ together for some time, but never tried to implement what follows:
Id like the python user to be able to write something like:
def foo(a,b):
return a+b
myclass.myfunc(foo)
where myclass is a c++ class exposed to python with Boost.Python, with one of its methods (myfunc) that takes a function with:
int func(int,int)
signature, and only that.
Is this possible?
Im thinking about declaring:
myclass::myfunc(boost::python::object)
and extracting the typedef'ed function signature, but im just guessing..
maybe there's a better/feasible way to do this, maybe with some 'function' object?