
Hi, I need to call boost::bind with 10 arguments. I believe that the maximum is nine. Is there a way to increase this? Thank you, Andrej

Peter Dimov wrote:
Andrej van der Zee wrote:
Hi,
I need to call boost::bind with 10 arguments. I believe that the maximum is nine. Is there a way to increase this?
There isn't, sorry.
Andrej, You might try using lambda::bind, which does seem to support functions with up to 10 parameters. HTH, Gevorg

On Sat, Mar 20, 2010 at 4:19 PM, Gevorg Voskanyan
Peter Dimov wrote:
Andrej van der Zee wrote:
Hi,
I need to call boost::bind with 10 arguments. I believe that the maximum is nine. Is there a way to increase this?
There isn't, sorry.
Andrej,
You might try using lambda::bind, which does seem to support functions with up to 10 parameters.
Or phoenix::bind which is configurable by a macro definition.

OvermindDL1 wrote:
Gevorg Voskanyan wrote:
Andrej,
You might try using lambda::bind, which does seem to support functions with up to 10 parameters.
Or phoenix::bind which is configurable by a macro definition.
Yes, PHOENIX_LIMIT is by default 10 so in this case it should work out of the box as well. I once needed to bind a function taking 12 parameters, so neither boost::bind nor boost::lambda::bind were able to help me in that. I turned to phoenix hoping it will do the job as it is configurable, but unfortunately I got compiler errors after defining PHOENIX_LIMIT or PHOENIX_COMPOSITE_LIMIT to anything greater than 10. I was then in a hurry so workarounded the problem by packing about half of the arguments in a dummy struct, creating a wrapper function taking the struct and the other parameters, and then binding that wrapper function with a struct instance and the rest of the arguments. I don't remember what and where exactly the error was, but it was with boost 1.38, so it might have got better since then. Gevorg
participants (4)
-
Andrej van der Zee
-
Gevorg Voskanyan
-
OvermindDL1
-
Peter Dimov