On Sun, 2010-03-21 at 03:07 +0100, peoro wrote:
> Yes, having all of the objects at their most-derived type would be
> what I need, but it's not what happens.
> 
> I posted a piece of C++ code that shows what I do (I exported it using
> py++ without any further modification): all of the pointers my
> functions return are wrapped in boost::shared_ptr's, but from Python I
> see them at the "derivation level" they were when I passed them to
> python the first time (look at the summarized output in my previous
> message)...
> 

Ok, maybe I'm not familiar with Py++ enough to help - I tend to just use
Boost.Python directly.

What I meant by "shared_ptr storage" is whether your class wrapper
declarations look like this:

boost::python::class_< wrapped, boost::shared_ptr<wrapped> >

or this:

boost::python::class_< wrapped >

If it's the former, the downcasting will happen automatically.  I would
guess Py++ has a switch that turns this on, but I don't know what it is.

Jim



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

Reply via email to