Created on2014-02-18.00:00:00 last changed109 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (October, 2014):
Change 13.2 [temp.param] paragraph 2 as follows,moving the example from paragraph 3 to paragraph 2:
There is no semantic difference betweenclassandtypename in atemplate-parameter.typename followed by anunqualified-id namesa template type parameter.typename followed byaqualified-id denotes the type in anon-type137parameter-declaration.Atemplate-parameter of the formclassidentifier is atype-parameter.[Example:
class T { /* ... */ }; int i; template<class T, T i> void f(T t) { T t1 = i; // template-parametersT andi ::T t2 = ::i; // global namespace membersT andi }Here, the templatef hasatype-parameter calledT, rather than anunnamed non-typetemplate-parameter of classT. —end example]. A storageclass shall not be specified in atemplate-parameterdeclaration. Types shall not be defined inatemplate-parameter declaration.
[Note: Atemplate parameter may be a class template. For example...—end note]
Change 13.2 [temp.param] paragraph 3 as follows,moving the example from paragraph 2 to paragraph 3:
Atype-parameter whose identifier does not followan ellipsis defines itsidentifier to beatypedef-name (if declared withclassortypename) ortemplate-name (if declaredwithtemplate) in the scope of the templatedeclaration.
[Note: Because of the name lookuprules, atemplate-parameter that could be interpretedas either a non-typetemplate-parameter oratype-parameter (because its identifier is the nameof an already existing class) is taken asatype-parameter. For example... —endnote][Note: A template parameter maybe a class template. For example,template<class T> class myarray { /* ... */ }; template<class K, class V, template<class T> class C = myarray> class Map { C<K> key; C<V> value; };—end note]
The Standard is not clear enough that a template parameter likeclass T is to be interpreted as a type parameter andnot an ill-formed non-type parameter of class typeT.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
| 2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
| 2015-04-13 00:00:00 | admin | set | messages: +msg5407 |
| 2014-11-24 00:00:00 | admin | set | status: tentatively ready -> dr |
| 2014-10-13 00:00:00 | admin | set | messages: +msg5143 |
| 2014-10-13 00:00:00 | admin | set | status: drafting -> tentatively ready |
| 2014-07-07 00:00:00 | admin | set | status: open -> drafting |
| 2014-02-18 00:00:00 | admin | create | |