From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-01-11 20:39:58


>From: "Paul Mensonides" <pmenso57_at_[hidden]>

> > 14.3.1/2 [quote--
> >
> > A local type, a type with no linkage, an unnamed type or a type
compounded
> > from any of these types shall not be used as a template-argument for a
> > template type-parameter.
> >
> > --end quote]
>
> Incidently, an unnamed type has no linkage. Secondly, even if it is
named,
> it has internal linkage if it is member of a class with internal linkage:
>
> namespace {
>
> template<class T> struct X {
> enum value_t { value = 10 };
> };

Right, but members of anonymous namespaces does have external linkage, so
this is not an example of that. That's an advantage over the deprecated
file-scope static, which does have internal linkage, and is therefore
unusable as template parameters.

The program you give compiles and runs without errors.

Regards,

Terje