[C++-sig] Re: Pickling problem

David Abrahams dave at boost-consulting.com
Mon Mar 1 17:02:48 CET 2004


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

> This does not work because return_internal_reference<> requires a
> pointer or reference. 

Yeah... but if getBase doesn't return a pointer or reference, then it
returns by value.  And if it returns by value, the static type of the
returned object is the same as its dynamic type, so I don't see how
you expect to end up with a Derived object.

> However, I think that :
>
> PyObject* test_base( Proxy& p )
> {
>   return
> return_internal_reference<1>::result_converter::apply<Base*>::type()(
> p.getBase() );
> }
>
> gives the same result that you suggested.

Not really.  That gives the same result you were getting before with
reference_existing_object.


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





More information about the Cplusplus-sig mailing list