This is the mail archive of the gcc-bugs@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: c++/7301: template template parameters are not correctly parsed when using 'typename'


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






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