Created on 2018-03-01.00:00:00 last changed 47 months ago
Proposed resolution, March, 2019:
Change 9.2.9.8 [dcl.type.class.deduct] paragraph 1 as follows:
If a placeholder for a deduced class type appears as a decl-specifier in the decl-specifier-seq of an initializing declaration (9.4 [dcl.init]) of a variable, the declared type of the variable shall be cv T, where T is the placeholder. [Example:
template <class ...T> struct A { A(T...) {} }; A x[29]{}; // error: no declarator operators allowed const A& y{}; // error: no declarator operators allowed—end example] The placeholder is replaced by the return type of the function selected by overload resolution for class template deduction (12.2.2.9 [over.match.class.deduct]). If the decl-specifier-seq is followed by an init-declarator-list or member-declarator-list containing more than one declarator, the type that replaces the placeholder shall be the same in each deduction.
Notes from the November, 2018 meeting:
The example is intended to be ill-formed; the intent is that declarator operators are not permitted, as with decltype(auto).
[Accepted as a DR at the July, 2019 meeting.]
An example like
template <class ...T> struct A { A(T...) {} }; A x[29]{};
Appears to be permitted by the current wording of the Standard, but existing implementations reject it. Should this usage be supported (in which case some mention of it in the wording would be useful) or prohibited?
History | |||
---|---|---|---|
Date | User | Action | Args |
2020-12-15 00:00:00 | admin | set | messages: + msg6412 |
2020-12-15 00:00:00 | admin | set | messages: + msg6411 |
2018-03-01 00:00:00 | admin | create |