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: g++ and templates


On Thursday 21 February 2008, Eljay Love-Jensen wrote:
> Hi Mihai,
> 
> > Can anyone tell me why the following code won't compile with g++ (4.1.2) ?
> 
> Because h was not declared in the scope it is being used in.
> 
> Try this:
> A<T>::h = t;
> 
> Or try this:
> this->h = t;
> 
> Or try this:
> using A<T>::h; // In B, outside of foo.
> h = t;
> 
> > It is, however, "digested" well by g++ 3.2.2 and g++ 3.3.4
> 
> GCC 3.2.x and 3.3.x were not C++ compliant on that issue.
> 
> Google for "two phase lookup".

Thank you for your quick reply. :)

-- 
Mihai DonÈu


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