
Marco Borm <mb.ml.boost@adisoft-systems.de> writes:
Marco Borm <mb.ml.boost@adisoft-systems.de> writes:
It is also possible to do the following in my c++ object-code: "ret = boost::python::call<int>(PyFunction.ptr(), this );" But not so elegant or safe as: ret = boost::python::extract<int>( PyFunction( *this ) );
David Abrahams wrote: thats true :-)
But now my problem: boost copies the object and passes only that copy to the function. Is it and how is it possible to make the object accessible to the function within the python-script? ret = boost::python::extract<int>( PyFunction( boost::ref(*this) ) ); To clarify: "this" isn't an instance of an boost/python object. The Instance is created somewhere else without boost/python.
Right, I expected that. The code I gave you is designed to account for that.
Because this, the code you gave me crashs in wrapper_base.hpp on an "dynamic_cast<wrapper_base const volatile*>(x)"
I'm pretty sure that is not why your code is crashing.
An example for what I want:
If you post an actual compilable example that reproduces the problem to the C++-sig (http://www.boost.org/more/mailing_lists.htm#cplussig) I might find time to debug it. -- Dave Abrahams Boost Consulting www.boost-consulting.com