I'm playing with the developer preview of Visual Studio 11.
One of the short-comings I've stumbled upon is std::bind only supporting 4 function arguments.
I can't find anything about this in the C++11 standards paper. Is there defined a minimum number of arguments, or is that all implementation dependent?
In VC11, you can crank up the number of max arguments used by the variadiac templates emulation scheme by setting _VARIADIC_MAX. Default is 5.
See here : http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx
If you need more arguments (e.g. you had code compiling with VC9 SP1 or VC10 that used 6-tuples), there's an escape hatch. You can define _VARIADIC_MAX project-wide between 5 and 10 inclusive (it defaults to 5). Increasing it will make the compiler consume more memory, and may require you to use the /Zm option to reserve more space for PCHes.
Actually, this is an implication of VC11 not supporting variadic templates yet. They could however hard code more than four. The Boost libraries do this all the time with boilerplate for up to ten arguments (check signals2 for example down in the details directory). Four arguments is an awful small number to stop with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With