On 18.06.19 16:13, Timon Gehr wrote:
>
> int sum(){ // note: just to illustrate the concept
> int result=0;
> foreach(i;iota(1000).parallel){
> static assert(typeof(result)==shared(int));
> result.atomic!"+="(i);
> }
> static assert(typeof(result)==int);
> return result;
> }
Return type should have been int, of course...