Created on1999-11-09.00:00:00 last changed277 months ago
Proposed resolution (10/00):
In 13.8 [temp.res] paragraph 5, replace
The keywordtypename shall only be applied to qualifiednames, but those names need not be dependent.
with
The keywordtypename shall be applied only to qualifiednames, but those names need not be dependent. The keywordtypename shall be used only in contexts in which dependentnames can be used. This includes template declarations anddefinitions but excludes explicit specialization declarations andexplicit instantiation declarations.
John Spicer:In 13.8 [temp.res] paragraph 5,the standard says
The keywordtypename shall only be used intemplate declarations and definitions...My understanding of the intent of this restriction is to say thattypename is only allowed in contexts in which templatedependent names can be found, but the wording leaves open tointerpretation whethertypename is allowed in an explicitspecialization, such as:
template <class T> struct A {}; template <class T> struct B { typedef int X; }; template <> struct A<int> { typename B<int>::X x; };My understanding is that such usage is not permitted.This should be clarified one way or the other.Mike Miller:I agree with your understanding that you are not allowed tousetypename in an explicit specialization. However, I thinkthe standard already says that — an explicit specializationis not a template declaration. According to the grammar inClause 13 [temp] paragraph 1, atemplate-declaration must have a non-emptytemplate-parameter-list.
Nathan Myers:Is there any actual reason for this restriction? Its only apparenteffect is to make it harder to specialize templates, with nocorresponding benefit.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2003-04-25 00:00:00 | admin | set | status: dr -> tc1 |
| 2000-11-18 00:00:00 | admin | set | status: ready -> dr |
| 2000-05-21 00:00:00 | admin | set | messages: +msg325 |
| 2000-05-21 00:00:00 | admin | set | status: open -> ready |
| 1999-11-09 00:00:00 | admin | create | |