Boost logo

Boost :

Subject: Re: [boost] Local and Phoenix idiosyncrasy
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-11-25 14:56:48


On 11/25/2011 08:37 PM, Thomas Heller wrote:
> On 11/25/2011 01:36 PM, Mathias Gaunard wrote:

>> Instead of
>>
>> BOOST_PHOENIX_ADAPT_FUNCTION(R, f_, f, N)
>>
>> /* ... */
>> void g()
>> {
>> /* ... */
>> my_higher_order_algorithm( f_(arg2, arg1) + arg3 )
>> }
>>
>> We could just write
>>
>> my_higher_order_algorithm( lazy(f)(arg2, arg1) + arg3 )
>
> This functionality already exists. It's called bind. What is bind missing?

You cannot write bind(f) like this.
You must write bind(f, arg1, arg2)

Also there is no complex machinery to involve here. It's just a function
that constructors a phoenix::function initialized from a PFO and returns it.


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