[C++-sig] copy constructors and multiple instances

Dave Abrahams dave at boostpro.com
Fri Sep 2 21:19:58 CEST 2011


on Thu Sep 01 2011, Jim Bosch <talljimbo-AT-gmail.com> wrote:

> boost::python::register_ptr_to_python< boost::shared_ptr<Scene> >();
>
> This allows you to return shared_ptr to Python, but because a
> boost::shared_ptr can use an arbitrary deleter, Boost.Python can
> convert any wrapped Scene object (even one that doesn't hold a
> shared_ptr<Scene>) into a shared_ptr<Scene> with correct reference
> counting.

I might have forgotten by now, but I don't think you need to register
shared_ptr, and I don't think the above will have any effect.  IIRC I
made sure shared_ptr support "just works" out-of-the-box.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



More information about the Cplusplus-sig mailing list