[C++-sig] Calling func that takes intrusive_ptr<Base> with intrusive_ptr<Derived>...

Roman Yakovenko roman.yakovenko at gmail.com
Fri Oct 20 11:05:35 CEST 2006


On 10/20/06, Mark Williams <mark at image-engine.com> wrote:
>
> I found the  query below in the December 2005 archive which would appear to be describing the exact same problem as my own.
>
> A follow-up by the original author suggested they'd made their own version of converter/shared_ptr_from_python.hpp in order
> to support their own SmartPtr type, but they were questioning whether this was indeed the correct path to take.
>
> I've not been able to find replies to either of these original queries so would be grateful for any pertinent information regarding
> intrusive_ptr usage. Does Boost.Python support intrusive_ptr to the same level as shared_ptr?  The documentation for
> register_ptr_to_python doesn't seen to suggest any particular dependency on any one shared pointer type.

Recently, I had a problem with custom smart pointer. David Abrahams helped me to
solve it. The solution with unittests and explanation could be found here:

http://tinyurl.com/y9jzop

I think you can replace smart_ptr_t with intrusive_ptr and all should work.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list