is there a difference between those two notations

Jonathan M Davis jmdavisProg at gmx.com
Mon Apr 30 10:04:12 PDT 2012


On Monday, April 30, 2012 17:19:00 Christian Köstlin wrote:
> reduce!((int a, int b){return a+b;})(iota(100))
> reduce!("a+b")(iota(100))
> 
> thanks in advance

The first one directly creates a lambda, whereas the second one uses a string 
mixin with std.function.binaryFunc to create a lambda. The lambda generated 
for the second one will be the same as the one given in the first. They're just 
different ways to do the same thing.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list