[C++-sig] return_arg

Ira Holtzer sheig222 at gmail.com
Thu Aug 4 14:59:29 CEST 2005


> You need to specify a return value policy when returning pointers and
> references from functions, because otherwise Boost.Python doesn't know
> how/whether to manage the lifetime of the thing referred to.  In this
> case, reference_existing_object looks like the right policy.  Since
> GetMyClass has no arguments, return_arg certainly can't be the right
> choice!

Can you please point me to where I can find an in-depth discussion of return
value policies?
Are the 6 models under boost::python docs' ConverterGenerator all I can
use/need?

> P.S. Next time I suggest you copy/paste your actual code and the actual
> error message.  It was
> specify_a_return_value_policy_to_wrap_functions_returning

Lol, sorry about that. The secret police here at where I work restrict us
from doing *very dangerous* stuff like downloading MP3's, zip files with
source code in them, installing winamp... Ohh and also posting to
newsgroups. I have to use a different 'dirty' workstation to post here so I
can't simply copy/paste.
I'll make an effort to be more accurate in the future.

Cheers,
Ira




More information about the Cplusplus-sig mailing list