|
Boost Users : |
Subject: Re: [Boost-users] boost::bind and max #args
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2010-03-22 15:23:36
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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net