This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: implicit typename is deprecated
thanks a lot. I got my answer :)
----- Original Message -----
From: "LLeweLLyn Reese" <llewelly@lifesupport.shutdown.com>
To: "erwan ancel" <erwan.ancel@free.fr>
Cc: <gcc-help@gcc.gnu.org>
Sent: Monday, January 27, 2003 11:39 AM
Subject: Re: implicit typename is deprecated
> "erwan ancel" <erwan.ancel@free.fr> writes:
>
> > Hi,
> > Does anyone know what this mean ?
> > "Implicit typename is deprecated"
>
> Dependent names which are type names are required to be qualified by
> the keyword 'typename'.
>
> A dependent name is a name which is dependent on a template parameter.
>
> struct A
> {
> struct nest{};
> };
>
> template<class T>
> struct contain
> {
> typedef typename T::nest;
> };
>
> In the example above, 'T::nest' is a dependent name. Other common
> dependent names are things like 'vector<T>::value_type' . Since
> the parameters with which a template will be instantiated cannot
> be known in general, and a given type may delcare 'nest' as a
> static member, a data member, or a type member, or not at all, it
> was felt the user should indicate when a dependent name is
> intended/expected to be a type name. This allows better error
> reporting, and potentially simpler implementation.
>
> > I got this message when compiling my template instanciations with gcc
3.2,
> > and the compilation fails, but I managed to compile this without any
> > warning/error with gcc 2.95.
> [snip]
>
> 3.2 is much closer to conformance than 2.95
>