Boost logo

Boost :

Subject: [boost] Phoenix.bind VS Lambda.bind
From: Alexey Tkachenko (alek.tkachenko_at_[hidden])
Date: 2010-04-09 13:13:54


Hi,
Now I'm looking at Phoenix and Lambda libraries. Could somebody
explain why Lambda allows to use the following expression:
void foo(int) { ... }
...
bind(foo, _1)(10);

yet Phoenix does not.
Phoenix requires to use helper variable:
void foo(int) { ... }
...
int i = 0;
bind(foo, _1)(i);

I've read document about "Forwarding Function Problem"
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm). I
understand the core issue, but how does Lambda.bind solve it?

Thank you,

Alexey.


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