'std::thread::thread': no overloaded function takes 7 arguments

c++

Solution

VS2012 does not fully support variadic templates. Also see this Blogpost: http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx

You can set the maximum number of arguments as high as 10 by defining this Macro `_VARIADIC_MAX`.

So just do something like `#define _VARIADIC_MAX 10`.

The default values is 5, 2 standard argument + 5 variadic ones for std::thread. Overall you can pass as much as 12 parameters by settings the value above.

Problem

I am using visual studio 2012 and the above error popups. My code is correct but seems like the compiler is limited to 7 arguments. What can I do If I want to pass 7 arguments? I can pass a struct but better not change my code if possible.

Original source