explicit specialization in non-namespace scope

Oskar Enoksson osken393@student.liu.se
Mon Sep 21 07:32:00 GMT 1998


>>>>> "Nathan" == Nathan Myers <ncm@nospam.cantrip.org> writes:

>> I believe this is incorrect.  I find no such restriction.
>> In addition, in 14.7.3 - Explicit specialization
>> [temp.expl.spec] we have:

>>    -17- A member or a member template may be nested within
>> many enclosing class templates. If the declaration of an
>> explicit specialization for such a member appears in
>> namespace scope, the member declaration shall be preceded
>> by a template<> for each enclosing class template that is
>> explicitly specialized.
>>
>> It would not be necessary to say "if" above if that were
>> the only place it could appear.
>
>Since I implemented this, I'd better defend myself. :-)
>
>    [temp.expl.spec] 
>     
>     An explicit specialization shall be declared in the namespace of
>     which the template is a member, or, for member templates, in the
>     namespace of which the enclosing class or enclosing class
>     template is a member.  An explicit specialization of a member
>     function, member class or static data member of a class template
>     shall be declared in the namespace of which the class template
>     is a member.  */

Thanks for all answers!

I can also report that Digital cxx rejects explicit member template
specializations.

To bad, it was very useful ...

/Oskar




More information about the Gcc mailing list