Created on 2022-07-03.00:00:00 last changed 27 months ago
Proposed resolution (approved by CWG 2022-07-15):
Change in 13.10.2 [temp.arg.explicit] paragraph 4 as follows:
... If all of the template arguments can be deduced or obtained from default template-arguments, they may all be omitted; in this case, the empty template argument list <> itself may also be omitted.
[Accepted at the July, 2022 meeting.]
Subclause 13.10.2 [temp.arg.explicit] paragraph 4 specifies:
Trailing template arguments that can be deduced (13.10.3 [temp.deduct]) or obtained from default template-arguments may be omitted from the list of explicit template-arguments.
[Note 1: A trailing template parameter pack (13.7.4 [temp.variadic]) not otherwise deduced will be deduced as an empty sequence of template arguments. —end note]
If all of the template arguments can be deduced, they may all be omitted; in this case, the empty template argument list <> itself may also be omitted.
The wording does not allow omitting the empty template argument list <> if all of the template arguments have been obtained from default template-arguments. For example:
template<typename T = int> int f(); int x = f(); // ill-formed per the wording int (*y)() = f; // ditto
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-08-19 07:54:33 | admin | set | status: ready -> cd6 |
2022-07-15 19:21:32 | admin | set | status: open -> ready |
2022-07-08 20:55:20 | admin | set | messages: + msg6879 |
2022-07-03 00:00:00 | admin | create |