This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: implicit typename is deprecated
- From: LLeweLLyn Reese <llewelly at lifesupport dot shutdown dot com>
- To: "erwan ancel" <erwan dot ancel at free dot fr>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: 27 Jan 2003 02:39:35 -0800
- Subject: Re: implicit typename is deprecated
- References: <002901c2c52e$24837e40$0100a8c0@brisedorient>
- Reply-to: gcc-help at gcc dot gnu dot org
"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