This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Issue with pointer redirection in inherited clauses


Tyler Earman <rem.intellegare@gmail.com> writes:

> "I have noticed that when (this is C++) inheriting a templatized derived
> class from a templatized base that in g++, references to elements of the
> base class have to be qualified with this-> or with the name of the base
> class put in front.  But this is NOT needed in the Windows C++ compilers
> so far as I can see.  For example, Queue<T> might have a rep and a size
> in it; and Deque<T> can be setup to inherit from Queue<T> and where it
> references rep, it has to be this->rep.  But with the Windows compilers,
> just rep works in the derived class."

This is two-phase lookup, q.v.  The Windoes C++ compilers apparently do
not implement it correctly.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]