Title
Parameters following a pack expansion
Status
open
Section
13.2 [temp.param]
Submitter
Richard Smith

Created on 2018-12-03.00:00:00 last changed 25 months ago

Messages

Date: 2018-12-03.00:00:00

The Standard is not clear, and there is implementation divergence, for an example like the following:

  template<class ...Types> struct Tuple_ { // _VARIADIC_TEMPLATE 
    template<Types ...T, int I> int f() { 
      return sizeof...(Types); 
    } 
  }; 
  int main() { 
    Tuple_<char,int> a; 
    int b = a.f<1, 2, 3>(); 
  } 

The question is whether the 3 is accepted as the argument for I or an error, exceeding the number of arguments for T, which is set as 2 by the template arguments for Tuple_. See also issue 2383 for a related example.

History
Date User Action Args
2018-12-03 00:00:00admincreate