On Sun, Mar 21, 2010 at 4:12 PM, peoro <peoro.n...@gmail.com> wrote:
> Ok, it does work as expected if class Base has got at least one virtual 
> member:
>
> from shared_ptr_inheritance import *
> type( base1() ) -> Base
> type( base2() ) -> Derived
> type( derived1() ) -> Derived
> type( base3( derived1() ) ) -> Derived
> type( derived2( base2() ) ) -> Derived
>
> Anyhow it looks like this doesn't depend on py++: py++ always
> generates the same boost::python code no matter of destructor's
> virtuality.

You are right, Py++ assumes that if you have class hierarchy than you
follow simple rules ( at least virtual destructor ).

> ...What if I cannot add a virtual function to the class Base?

As for me, you should not use/expose such code :-) .

More seriously, you will have to show a small and complete example of
what you are trying to expose. In any case, without virtual table you
can't expect the "desired functionality" to work.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to