Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-08-05 10:25:50


lxcypp lxc:
> Thank you for your replay.
>
> You mean:
> when Python call C++ function , it will pass a RAW pointer (NOT a
> shared_ptr) to C++, and when pointer implict convert to a shared_ptr<T>,
> we
> got a totally different shared_ptr to the pointer, so that the
> _internal_weak_this will be reinitialized .
>
> Is that right?

Not exactly, but the end result is the same. Python does pass a raw pointer
(PyObject*) to the Boost.Python translation layer. Boost.Python then
constructs a specially crafted shared_ptr<A> from that. There is no implicit
conversion from T* to shared_ptr<T>.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net