Title
Missing non-deduced context following a function parameter pack
Status
cd3
Section
13.10.3.2 [temp.deduct.call]
Submitter
James Widman

Created on 2011-09-02.00:00:00 last changed 123 months ago

Messages

Date: 2012-10-15.00:00:00

[Moved to DR at the October, 2012 meeting.]

Date: 2012-02-15.00:00:00

Proposed resolution (February, 2012):

Change 13.10.3.2 [temp.deduct.call] paragraph 1 as follows:

...For a function parameter pack that does not occur at the end of the parameter-declaration-list, the type of the parameter pack is a non-deduced context. When a function parameter pack appears in a non-deduced context (13.10.3.6 [temp.deduct.type]), the type of that parameter pack is never deduced. [Example:

  template<class ... Types> void f(Types& ...);
  template<class T1, class ... Types> void g(T1, Types ...);
  template<class T1, class ... Types> void g1(Types ..., T1);

  void h(int x, float& y) {
    const int z = x;
    f(x, y, z);                  // Types is deduced to int, float, const int
    g(x, y, z);                  // T1 is deduced to int; Types is deduced to float, int
    g1(x, y, z);                 // error: Types is not deduced
    g1<int, int, int>(x, y, z);  // OK, no deduction occurs
  }

end example]

This resolution also resolves issue 1399.

Date: 2011-09-02.00:00:00

Presumably 13.10.3.6 [temp.deduct.type] paragraph 5 should include a bullet for a function parameter or function parameter pack that follows a function parameter pack.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-05-03 00:00:00adminsetstatus: dr -> drwp
2012-11-03 00:00:00adminsetmessages: + msg4163
2012-11-03 00:00:00adminsetstatus: ready -> dr
2012-02-27 00:00:00adminsetmessages: + msg3739
2012-02-27 00:00:00adminsetstatus: open -> ready
2011-09-02 00:00:00admincreate