www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15860] New: lockstep should support foreach_reverse

https://issues.dlang.org/show_bug.cgi?id=15860

          Issue ID: 15860
           Summary: lockstep should support foreach_reverse
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: petar.p.kirov gmail.com

auto arr1 = [1, 2, 3, 4, 5];
auto arr2 = [6, 7, 8, 9, 10];

foreach_reverse (ref a, b; lockstep(arr1, arr2))
    a += b;

assert (result == [15, 13, 11, 9, 7]);

Forum thread: http://forum.dlang.org/post/lgqnssnayocvxdjpqkns forum.dlang.org

--
Apr 01 2016