This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7301: template template parameters are not correctly parsed when using 'typename'
- From: Kriang Lerdsuwanakij <lerdsuwa at users dot sourceforge dot net>
- To: Thomas Mang <a9804814 at unet dot univie dot ac dot at>, lerdsuwa at gcc dot gnu dot org, a9804814 at unet dot univie dot ac dot at, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: Thu, 18 Jul 2002 20:12:21 +0700
- Subject: Re: c++/7301: template template parameters are not correctly parsed when using 'typename'
- References: <20020714152007.28249.qmail@sources.redhat.com>
Check out the language grammar, either from the standard or
say The C++ Programming 3rd Ed or special Ed. Only 'class'
is allowed in the grammar. The idea is with template type parameter,
you can substitute it with any type such as 'int', etc. So using 'class'
there seems like it's restricted to class types, not any type like
'typename'.
But with template template parameter, you can only substitute it with a
template class.
--Kriang
At 11:15 17/7/02 +0200, Thomas Mang wrote:
Lots of greetings,
Well, but isn't a template template parameter a special case of a template
parameter(one, where the templated type is itself a template)?
To use a metaphor, I think a 'template parameter' could be a base class,
and a 'template template parameter' would be a derived class.
After all, template template parameters rely on template parameters (to
instantiate the template template parameter).
And as 'typename' and 'class' can be used interchangeable with template
parameters, my (doubtless) point - of - view is they should be also able
to be used interchangeably with template template parameters.
best regards
Thomas
lerdsuwa@gcc.gnu.org schrieb:
Synopsis: template template parameters are not correctly parsed when
using 'typename'
State-Changed-From-To: open->closed
State-Changed-By: lerdsuwa
State-Changed-When: Sun Jul 14 08:20:06 2002
State-Changed-Why:
Not a bug. 'typename' and 'class' can be interchanged only
for template type parameters, not template template parameters.
<http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7301>http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7301