Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-03-09 15:13:46


Marco Borm <mb.ml.boost_at_[hidden]> 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 ) );

> 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) ) );

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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk