Lambda syntax, etc

grauzone none at example.net
Mon Feb 9 06:20:31 PST 2009


> // 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.



More information about the Digitalmars-d mailing list