
25 Nov
2011
25 Nov
'11
7:56 p.m.
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.