
2 Oct
2008
2 Oct
'08
2:15 p.m.
Joel de Guzman:
Oh my, there's a lot of discussion I can't find that snippet of information. Anyway, it has something to do about using the "let" semantics be applied to "lambda" only on the top level. I think it will work with the lambda syntax and behavior you sought for.
Not quite. The purpose of unlambda is to allow you to pass a lambda expression into a function that expects an ordinary function object and might use it as a part of another lambda expression. template<class F> void g( F f ) { h( bind( f, _2, _1 ) ); } int main() { g( _1 < _2 ); // fail g( unlambda( _1 < _2 ) ); // works } A top-level lambda[] that does let()[] will not work for this case.