
On Tue, Jul 1, 2008 at 5:39 PM, Eric Niebler <eric@boost-consulting.com> wrote:
Giovanni Piero Deretta wrote:
- What are exactly the quirks that makes it hard to have full backward compatibility? Well except for 'sig' of course.
Wish I had written them all down. One that sticks in my mind is whether variables are captured by value or by reference. With Phoenix, it's very consistent ... all variables are captured by value, always. Lambda tries to be a bit more helpful, and it makes the rules more confusing, IMO. Most of the time, variables are captured by value, but a variable on the left of an assignment is captured by reference. This includes all the assignment operators, like plus-assign. So the following is a valid lambda expression:
int i = 0; i += _1;
But in Phoenix, it would have to be:
int i = 0; ref(i) += _1;
D'uh, I didn't know boost.lambda did that! I always stick a ref() in these cases. The only "help" that lambda provided, that I knew of, was with 'cout' (and similar) and array types. So this won't affect me at least. -- gpd