Lambda syntax, etc

Kagamin spam at here.lot
Tue Feb 10 05:29:10 PST 2009


grauzone Wrote:

> > // syntax for lambda that contains a single expression, implicit return (this is the most common case):
> > auto r = find!(a => a.Weight > 100)(range);
> 
> I really like this one, but I'd prefer something like
>  > auto r = find(range, {a -> a.Weight > 100});
> 
> Note the -> instead of the =>, to avoid any ambiguities with the 
> comparison operator.

auto r = find(range, {a -> a.Weight <- 100});

:)



More information about the Digitalmars-d mailing list