Boost logo

Boost Users :

Subject: Re: [Boost-users] [bind]Help! Can we modify parameters before pass them into bind (see the context below for details)
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-08-22 21:20:38


On Sun, Aug 22, 2010 at 12:21 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> AMDG
>
> jungleman wrote:
>>
>> I have some problems on function template bind.
>>
>> the original usage of bind is : bind(func, _1, _2), and I wonder whether I
>> can modify the parameters before pass them into bind, for example,
>> functype
>> function = bind(func, *_1, *_2).
>>
>> So that, when I use function(a, b), it will do like this: func(*a, *b).
>>
>> May it work, or some way else to do this? I just wanna do this in one line
>> code.
>>
>
> Use Boost.Lambda.

Or Boost.Phoenix (replacing Boost.Lambda):
  namespace ph = boost::phoenix;
  using boost::phoenix;
  function = ph::bind(func, *arg1, *arg2); // might work, give it a try?


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