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
>   
Well at least using Base<T>::data seems a bit more intuitive than this->
(as far as readable code goes).  Also it seems to be possible to use the
"using Base<T>::data" declaration, which would be obvious I would guess.

Thanks Ian, I guess that takes care of the issue as far as it can be solved.

-Tyler

[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