[C++-sig] [Py++] boost::shared_ptr casting

Nat Goodspeed nat at lindenlab.com
Mon Mar 22 02:20:52 CET 2010

peoro wrote:

> There should be no need of dynamic_cast or any kind of run time type
> checking since the program has got static knowledge of types: 

The C++ program may have that knowledge. All I'm saying is that your 
original issue concerned Python determining the runtime type (leaf 
class) of each object.

> managed to get around the problem with a simple
> hack: prior to pass a shared_ptr to Python for the first time, I just
> pass it to Python casted to its most-derived class.

I'm glad you've got a solution that works for you.

More information about the Cplusplus-sig mailing list