[Issue 8155] Deprecate std.range.lockstep

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 28 09:46:39 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=8155



--- Comment #9 from bearophile_hugs at eml.cc 2013-06-28 09:46:37 PDT ---
(In reply to comment #8)

>     auto arr1 = new double[10];
>     foreach(i, ref x; zip(iota(10), arr1))
>     {
>         x = i;
>     }
>     writeln(arr1);
> 
>     auto arr2 = new double[10];
>     foreach(i, ref x; lockstep(iota(10), arr2))
>     {
>         x = i;
>     }
>     writeln(arr2);

Let me add a note. For your specific use case it's better to use enumerate(),
from Issue 5550 :

    auto arr1 = new double[10];
    foreach (i, ref x; arr1.enumerate)
        x = i;
    arr1.writeln;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list