[C++-sig] Re: manage_new_object using release() instead of delete
David Abrahams
dave at boost-consulting.com
Sat May 8 02:36:10 CEST 2004
"Eric" <wstwej03 at sneakemail.com> writes:
> This has worked like a charm, thanks very much.
>
> In order to get it to work, I had do to two things which I thought might be
> candidates for improvement.
>
> The first is that I had to manually add some code to my BP initialization
> file to create a class_value_wrapper for each type I wanted to use
> shared_ptr with.
Why are you messing around with that undocumented stuff? It's a
Boost.Python library implementation detail and not for public
consumption. Are you wrapping lots of functions that return these
objects by value?
> Perhaps this is the kind of code that Pyste could be used
> to auto-generate?
>
> The second was that I had to use a special functor so that I could
> use a member-function pointer instead of a void function pointer for
> the custom delete. Both issues are illustrated below.
>
> I wonder if there is also something like ReleaseFunctor below in boost for
> use with shared_ptr...?
boost::mem_fn(&T::release)
<snip> [Please try to limit the amount of quoted text in your
replies.]
--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
More information about the Cplusplus-sig
mailing list