This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: g++ and templates
- From: Mihai DonÈu <mihai dot dontu at gmail dot com>
- To: Eljay Love-Jensen <eljay at adobe dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 21 Feb 2008 16:55:35 +0200
- Subject: Re: g++ and templates
- References: <C3E2E93E.1BDF%eljay@adobe.com>
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