Automatic Foreach

e-t172 e-t172 at akegroup.org
Sun Apr 27 07:43:37 PDT 2008


Janice Caron a écrit :
> I think I'd be happy with a template in std.algorithm.
> 
>     // a[] = b[] + c[]
>     auto a = parallel!("a = b + c")(a,b,c);
> 
>     // foo(array1[], array2[], array3[], array4[])
>     parallel!("foo(a,b,c,d)")(array1,array2,array3,array4);
> 
> Or some such. I'm sure Andrei could write that. He's a clever guy.

Basically, that would be an equivalent of the "map" function present in 
functional programming languages.



More information about the Digitalmars-d mailing list