Created on 1998-09-19.00:00:00 last changed 196 months ago
[Moved to DR at 4/01 meeting.]
[Moved to DR at 4/01 meeting.]
Notes from 10/00 meeting:
The core working group felt that the value of additional clarity here outweighs the potential disadvantages that were noted at the preceding meeting.
Notes from 04/00 meeting:
This issue was kept in "review" status for two major reasons:
Some compilers reject the following:
struct A { template <int I> void f(); template <> void f<0>(); };on the basis of 13.9.4 [temp.expl.spec] paragraph 2:
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. ...claiming that the specialization above is not "in the namespace of which the enclosing class ... is a member". Elsewhere, declarations are sometimes required to be "at" or "in" "namespace scope", which is not what it says here. Paragraph 17 says:
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.The qualification "if the declaration ... appears in namespace scope", implies that it might appear elsewhere. The only other place I can think of for a member specialization is in class scope.
Was it the intent of the committee to forbid the construction above? (Note that A itself is not a template.) If so, why?
Proposed resolution (04/01): In-class specializations of member templates are not allowed. In 13.9.4 [temp.expl.spec] paragraph 17, replace
If the declaration of an explicit specialization for such a member appears in namespace scope...with
In an explicit specialization for such a member...
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2003-04-25 00:00:00 | admin | set | status: dr -> wp |
2002-05-10 00:00:00 | admin | set | messages: + msg695 |
2001-05-20 00:00:00 | admin | set | status: ready -> dr |
2000-11-18 00:00:00 | admin | set | messages: + msg407 |
2000-11-18 00:00:00 | admin | set | status: review -> ready |
2000-05-21 00:00:00 | admin | set | messages: + msg340 |
2000-02-23 00:00:00 | admin | set | messages: + msg233 |
2000-02-23 00:00:00 | admin | set | status: open -> review |
1999-09-14 00:00:00 | admin | set | status: review -> open |
1998-09-19 00:00:00 | admin | create |