[C++-sig] Re: Pickling problem

David Abrahams dave at boost-consulting.com
Mon Mar 1 15:28:42 CET 2004


Pierre Barbier de Reuille <pierre.barbier at cirad.fr> writes:

> Ok, I've found the solution of my problem. 
> If I create a function with this implementation :
>
> PyObject* test_base( Proxy& p )
> {
>   return reference_existing_object::apply<Base*>::type()( p.getBase() );
> }
>
> The PyObject* will have the correct type (ie. not Base* but the dynamic
> type of the result).

The solution I posted is cleaner and won't leave you with dangling
references.

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





More information about the Cplusplus-sig mailing list