Title
Incorrect comment in example of template parameter pack restriction
Status
cd3
Section
13.2 [temp.param]
Submitter
Johannes Schaub

Created on 2011-03-25.00:00:00 last changed 131 months ago

Messages

Date: 2012-02-15.00:00:00

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

Date: 2011-08-15.00:00:00

Proposed resolution (August, 2011):

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

...A template parameter pack of a function template shall not be followed by another template parameter unless that template parameter can be deduced from the parameter-type-list of the function template or has a default argument (13.10.3 [temp.deduct]). [Example:

  template<class T1 = int, class T2> class B;   // error

  // U cannot be deduced from the parameter-type-list or specified
  template<class... T, class... U> void f() { } // error
  template<class... T, class U> void g() { }    // error

end example]

Date: 2012-09-24.00:00:00

The following example from 13.2 [temp.param] paragraph 11 is incorrect:

  // U cannot be deduced or specified
  template<class... T, class... U> void f() { }
  template<class... T, class U> void g() { }

In fact, U can be deduced to an empty sequence by 13.10.2 [temp.arg.explicit] paragraph 3:

A trailing template parameter pack (13.7.4 [temp.variadic]) not otherwise deduced will be deduced to an empty sequence of template arguments.
History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2012-11-03 00:00:00adminsetstatus: dr -> drwp
2012-09-24 00:00:00adminsetmessages: + msg4013
2012-02-27 00:00:00adminsetmessages: + msg3830
2012-02-27 00:00:00adminsetstatus: ready -> dr
2011-03-25 00:00:00admincreate