[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-cpp-sig
Subject:    Re: [C++-sig] copy constructors and multiple instances
From:       Dave Abrahams <dave () boostpro ! com>
Date:       2011-09-02 21:15:32
Message-ID: m2bov2ejd7.fsf () boostpro ! com
[Download RAW message or body]


on Fri Sep 02 2011, Josh Stratton <strattonbrazil-AT-gmail.com> wrote:

> Well, right now I'm just passing "this" from inside the scene object,
> so does that need to be wrapped in a shared pointer?

That's a pretty vague description of what you're doing, so it's hard to
say.  I suggest you reduce your question to a minimal case that doesn't
involve any of your domain-specific stuff.  Then it will be easy to
answer.

>
> On Fri, Sep 2, 2011 at 12:19 PM, Dave Abrahams <dave@boostpro.com> wrote:
>>
>> 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>
>> _______________________________________________
>> Cplusplus-sig mailing list
>> Cplusplus-sig@python.org
>> http://mail.python.org/mailman/listinfo/cplusplus-sig>

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

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic