Hans Meine <meine <at> informatik.uni-hamburg.de> writes:
>
> On Monday 10 November 2008 08:56:14 Gennadiy Rozental wrote:
> > It can be resolved with additional export for class Derived:
> >
> > bp::class_<Derived,bp::bases<Base>,noncopyable>
> > ( "Derived", bp::no_init );
> >
> > In which case above print statement starts
> > to show mymodule.Derived.
>
> AFAICS that's the proper solution.
My current workaround looks like this:
Base*
as_base( IObject* obj )
{
return dynamic_cast<Base*>( obj );
}
Next I export this function and use if in Python in all
point of foo() invocation:
mymodule.as_base( object_derived_from_base ).foo()
Gennadiy
_______________________________________________
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig