This is the mail archive of the gcc@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]

Re: explicit specialization in non-namespace scope



>>>>> "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



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