Title
Default arguments and parameter packs
Status
cd2
Section
9.3.4.7 [dcl.fct.default]
Submitter
Michael Wong

Created on 2009-02-13.00:00:00 last changed 139 months ago

Messages

Date: 2010-03-15.00:00:00

[Voted into WP at March, 2010 meeting.]

Date: 2009-10-15.00:00:00

Proposed resolution (October, 2009):

Change 9.3.4.7 [dcl.fct.default] paragraph 4:

...In a given function declaration, all each parameters subsequent to a parameter with a default argument shall have a default arguments supplied in this or a previous declarations or shall be a function parameter pack. A default argument...
Date: 2009-02-13.00:00:00

9.3.4.7 [dcl.fct.default] paragraph 4 says,

In a given function declaration, all parameters subsequent to a parameter with a default argument shall have default arguments supplied in this or previous declarations.

It is not clear whether this applies to parameter packs or not. For example, is the following well-formed?

    template <typename... T> void f(int i = 0, T ...args) { }

Note for comparison the corresponding wording in 13.2 [temp.param] paragraph 11 regarding template parameter packs:

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.
History
Date User Action Args
2010-03-29 00:00:00adminsetmessages: + msg2708
2010-03-29 00:00:00adminsetstatus: ready -> cd2
2009-11-08 00:00:00adminsetmessages: + msg2360
2009-11-08 00:00:00adminsetstatus: drafting -> ready
2009-02-13 00:00:00admincreate