Re: Parameter pack in non-last position in function formal parameter list?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 19 Jun 2015, Avi Kivity wrote:

Consider

 template <typename... X, typename Y>
 void f(X... x, Y y) {
 }


 int main(int ac, char** av) {
   f(1, 2, 3, 4);
   return 0;
 }

is this legal?

No.

So it's not complaining that f() is illegal, yet it id not deducing X... as int, int, int.

That's what the standard says. You can still call it as:
f<int,int,int>(1, 2, 3, 4);

(the question is not specific to gcc, so it would be more appropriate on a general C++ forum like stackoverflow.com)

--
Marc Glisse



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux