[C++-sig] Re: Inheritance with B/P

Bruce Lowery bruce_lowery at yahoo.com
Fri Feb 7 19:56:57 CET 2003


--- Mike Rovner <mike at bindkey.com> wrote:
> "Bruce Lowery" <bruce_lowery at yahoo.com> wrote in message
> > > >> d = mod.Derived()
> > > >> s = mod.SomeOther()
> > > >> s.someOther( d )
> > > > TypeError:  bad argument type for built-in operation
> > > >>
> > > >
> > > > In reality, the wrappers "hold" Base and Derived using auto_ptr:
> > > >
> > > > class_< Base, auto_ptr<Base> >(...) ...;
> > > > class_< Derived, auto_ptr<Derived>, bases<Base> >(...) ...;
> > > >
> > > > Any ideas?
> 
> For me it's look like a C++ problem not a Python problem.
> auto_ptr<Derived> is not inherited from auto_ptr<Base> and/or
> there is no automatic conversion from former to later.
> 

Well, I've built the simplified version I gave previously, including the use of
auto_ptr to 'hold' the classes, and it appears to work.  So, it's something
else, likely screened from detection by its obviousness....

Thanks for wasting time thinking about this.

Bruce Lowery

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com




More information about the Cplusplus-sig mailing list