Re: C++ inheritance question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tyler Earman <rem.intellegare@xxxxxxxxx> writes:

> Outside of the this-> operators, is there a better way of doing it?

Not that I know of.

> I've
> been working with virtual inheritance, by applying virtual interfaces,
> but this is also generating a large amount of errors (code bellow).

In your example, the reference to data in C::f appears to be
non-dependent, but it is actually dependent.  You need to make clear to
the compiler that it is dependent.  I think using this-> is the best
approach, and in fact I pretty much always use this-> even when it is
not required.  In your example, you could also write Base<T>::data.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux