Boost logo

Boost :

Subject: Re: [boost] Help with Boost Preprocessor
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2009-08-30 17:39:42


On Sun, Aug 30, 2009 at 12:31 PM, Emil
Dotchevski<emildotchevski_at_[hidden]> wrote:
> On Sun, Aug 30, 2009 at 6:03 AM, OvermindDL1<overminddl1_at_[hidden]> wrote:
>> On Sun, Aug 30, 2009 at 2:56 AM, Emil
>> Dotchevski<emildotchevski_at_[hidden]> wrote:
>>> Steven, thanks for your reply.
>>>
>>> It is too late for me right now to understand your solution, but at
>>> first look it seems like it's very close to what I need but not quite.
>>> :)
>>>
>>> The interface I need is something like:
>>>
>>> CALL_PROD3(boost::bind(func(),_1,_2,_3,42),TYPE_LIST)
>>>
>>> I do want to use bind (so I can pass any number of additional
>>> arguments to the function), and I don't want the function name or the
>>> type list macro name to be hard-coded. I just don't like the *nested*
>>> use of bind in the solution I posted, and the fact that the type list
>>> macro name is hard-coded in the helper functions fwd1 and fwd2.
>>
>> It looks like for what you are doing then Boost.Phoenix and/or
>> Boost.Fusion would do what you want without the prepocessor or tons of
>> overloads.
>
> Can you give me a more specific starting point?

>From what I gather (might be wrong) it seems like you are trying to
create bindings of multiple unknown types and handling things by
binding, most of that can be handled by fusion's invoke and its kin
functions. Boost.Function_Types actually has an interpreter example
that uses fusion for about half of what you would need. I am really
short on time at the moment and do not full understand your problem
domain yet, but if you give a lot of pseudo-code about what you want
done (not how you are currently trying to do it, but what you are
trying to achieve), then I might try to whip up an example on Tuesday
or so unless you or someone else beat me to it.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk