[C++-sig] inheritance and polyphormism

Luca Sbardella luca.sbardella at gmail.com
Mon Jun 11 13:58:46 CEST 2007


If you mean doing

class derived_wrap: public derived, public boost::python::wrapper<derived>,
public boost::python::wrapper<base>  {
  void method2() {....}
};

This doesn't compile. It throw the error ambiguous access of 'get_override'
inside the function method2(). I guess it creates a confusion to which class
to overwrite (just a guess!!).
Luca




On 11/06/07, Roman Yakovenko <roman.yakovenko at gmail.com> wrote:
>
> On 6/11/07, Luca Sbardella <luca.sbardella at gmail.com> wrote:
> > The link doesn't answer the question, or at least I do not see the
> answer.
> >
> > At first, I though that using the following approach would work
> >
> >
> >  class derived_wrap: public derived, public
> > boost::python::wrapper<derived>  {
> >    void method2() {....}
> >  };
>
> You can derive from boost::python::wrapper< base > class too. I think
> this will do what you want.
>
> --
> Roman Yakovenko
> C++ Python language binding
> http://www.language-binding.net/
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070611/a09e146b/attachment.htm>


More information about the Cplusplus-sig mailing list