|
Boost : |
From: John Max Skaller (skaller_at_[hidden])
Date: 2001-06-26 17:25:38
williamkempf_at_[hidden] wrote:
> > You can see this because the above code has an error: the
> > keyword 'templatename' is required:
>
> There is no C++ keyword "templatename". I assume you mean "typename".
I meant templatename, but I accept that you're right
this didn't make it into the Standard.
> > templatename TT::dummy<T2> y;
> >
> > so the parser knows that
> >
> > TT::dummy
> >
> > is the name of a template (not a type or variable).
>
> The name in question *is* a type, even if it's a template type.
No it isn't. The name in question is
TT::dummy
and it is not the name of a type. It is the name of a template.
This is why I assumed that templatename made it into the
Standard. However, 'typename', although incorrect,
is enough information in this case to ensure that the parser
considers the < in the expression
TT::dummy < .....
as the opening bracket of an instantiation, rather than
a less than operator, since < can't follow a typename
at all, the parser can just assume 'typename' actually
meant 'templatename'.
You should note that function templates are not types,
but are still templates. you should also note that
classes are not types (but class names do name types
sometimes)
-- John (Max) Skaller, mailto:skaller_at_[hidden] 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 New generation programming language Felix http://felix.sourceforge.net Literate Programming tool Interscript http://Interscript.sourceforge.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk