
David Abrahams <dave@boost-consulting.com> writes: | Gabriel Dos Reis <gdr@integrable-solutions.net> writes: | | > In -a- model I discussed a while ago with the second author of | > decltype/auto proposal, lambdas are unnamed constants that can be | > implemented by local classes. The body of the lambda would be | > forwarded-to by the appropriate overload of the call operator, | > i.e. your example would be | > | > foo: () -> auto { | > int i; | > | > struct xxx { | > operator(): (int x) -> auto { return i + x; } | > }; | > }; | | Is foo missing a return statement? Yes: It is missing return xxx(); Thanks! [...] | > Note that I want the lambdas to be constants, in particular I would | > like to be able to use them as template arguments. Note also the type | > inference that can refer to local classes :-) | | Sounds lovely ;-) :-) How else would I have my expression templates without turning C++ into Haskell? ;-) -- Gaby