Boost logo

Boost :

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

Marco Borm <[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

Boost list run by bdawes at, gregod at, cpdaniel at, john at