[C++-sig] How to wrap function pointer in python?

David Abrahams dave at boost-consulting.com
Tue Mar 18 15:43:26 CET 2003


David Abrahams <dave at boost-consulting.com> writes:

> What you're trying to do isn't possible, for Boost.Python or any other
> wrapping system other than *possibly* something like weave which
> recompiles C++ code on the fly during execution.  See
> http://aspn.activestate.com/ASPN/Mail/Message/1554837 for more
> details.

I've just added a FAQ about this; it's in the CVS and will go out
with 1.30.0.  One thing I added which wasn't in my reply is:

     If you have the luxury of changing the C++ code you're wrapping,
     pass it a boost::python::object instead and call that; the
     overloaded function call operator will invoke the Python function
     you pass it behind the object.


-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list