5 Aug
2008
5 Aug
'08
2:25 p.m.
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>.