<div dir="ltr"><div><div><div><div>Suppose I have the following piece of code<br><br>import std.parallelism;<br><br>void main() {<br> int[] data = new int[1000_000_00];<br><br> foreach(i, ref el; parallel(data)) {<br>
if (i > 10 && i < 1000_000_00 - 10)<br></div><div> data[i] = data[i-10] + data[i+10];<br></div><div> }<br>}<br><br></div>That's right, I want to process all the elements of the array, except for first 10 and last 10.<br>
</div>Is there a way to do that without if statement?<br></div><br></div><div>I mean something like foreach starting from element with index 10 and ending with lendth - 10<br></div><div><div><div><div><br></div></div></div>
</div></div>