each! vs foreach parallel timings

Jay Norwood via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 27 16:17:56 PST 2015

> On Sunday, 27 December 2015 at 23:42:57 UTC, Ali Çehreli wrote:
>> That does not compile because i is size_t but apply_metrics() 
>> takes an int. One solution is to call to!int:
>>         foreach( i, ref a; parallel(samples[])){ 
>> apply_metrics(i.to!int,a);}

It builds for me still, and executes ok, but must be because 
size_t and i are both 32 bits on Win32 build.

More information about the Digitalmars-d-learn mailing list