This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 113d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-03-20


1068. Template aliases with default arguments and template parameter packs

Section: 13.2  [temp.param]     Status: C++11     Submitter: Nikolay Ivchenkov     Date: 2010-03-27

[Voted into the WP at the March, 2011 meeting.]

Since there appear to be no restrictions against it, it would appear that default arguments and template parameter packs can be used with template aliases just as with other templates. If that is the case, then, the current wording in 13.2 [temp.param] paragraph 11 requires adjustment:

If a template-parameter of a class template has a default template-argument, each subsequent template-parameter shall either have a default template-argument supplied or be a template parameter pack. If a template-parameter of a class template is a template parameter pack, it shall be the last template-parameter.

Presumably these restrictions should also apply to template aliases, but as written, they only apply to class templates.

Proposed resolution (January, 2011):

Change 13.2 [temp.param] paragraph 11 as follows:

If a template-parameter of a class template or alias template has a default template-argument, each subsequent template-parameter shall either have a default template-argument supplied or be a template parameter pack. If a template-parameter of a primary class template or alias template is a template parameter pack, it shall be the last template-parameter. [Note:...