IR wrote:
Quote:
Hello,
>
Does anyone know why this declaration compiles:
>
template< template<typenameclass T>
class X { /*...*/ };
>
while this one doesn't:
>
template< template<typenametypename T>
class X { /*...*/ };
>
>
I thought "class" and "typename" were equivalent in template
declarations?
They are, but only if you use them alone. What you have here is
a template template argument and you cannot use 'typename' there,
it has to be 'class'. See 14.1/1 for the syntax.
Quote:
I don't think it's my compiler's fault (VC8) because I couldn't find
references to syntaxes like the second one on the web, only like the
first one, so there must be a logical reason...
>
Even Comeau's FAQ uses the first form, without even mentioning the
second one.
Because there is no "second one". The syntax rules require "class"
there.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask