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

2024-12-06


1246. Non-deduced non-final parameter packs

Section: 13.2  [temp.param]     Status: C++11     Submitter: John Spicer     Date: 2011-02-23

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

According to 13.2 [temp.param] paragraph 11,

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 primary class template is a template parameter pack, it shall be the last template-parameter. [Note: These are not requirements for function templates or class template partial specializations because template arguments can be deduced (13.10.3 [temp.deduct])...

Should the Standard forbid non-final parameter packs in cases where the declaration does not allow the template arguments to be deduced? For example,

    template<typename... T, typename... U> void f() { }
    template<typename... T, typename U> void g() { }

(See also issue 549.)