Re: Template class heritance strange behaviour

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

 



Hi rodrigob,

>     //c = _d; // <<< this line generates error : 'c' was not declared
> in this scope

Yep, that is an error. That line (if uncommented) is bad C++.

>     this->c = _d; // this access work  fine

Yep, that is correct.  That's C++.

>     Parent<T2>::c = _d; // this access work  fine too

Yep, that is correct.  That's C++, too.

In Child, I think you can also use something like:

  using Parent<T2>::c;

Google for "Koenig lookup" (two phase lookup) if you want details.

Here's one URL:
http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,9
90,00.html

HTH,
--Eljay


[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