Rainer Deyke wrote:
So here's my first impression. It's simple, clean, and elegant. However, it doesn't appear to solve any problem I have. In a world where C++ already has "real" lambda expressions as a language feature, is there any need for another lambda library?
I assume that the appeal of lambda2 is that it involves less typing.
My impression is similar. I've just gone through my current codebase looking for lambdas that I could re-write using this syntax. Most can't, even the short ones, because I invoke functions or access members, and fn(_1) and _1.field aren't possible. Even when the placeholder form is possible, I lose my meaningful parameter names and possibly types. Pre-C++11 I used to have code that used boost::lambda or similar, but I converted it all to use core language lambdas years ago. I guess that if there are people who still have code using boost::lambda, they may find that they can use lambda2 as a near drop-in replacement and maybe get faster compilation, or something. But I would suggest that they should grasp the nettle and update to just use core-language lambdas. Are there any cases where converting an old boost::lambda expression to a core-language lambda is particularly problematic? Regards, Phil.