www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16145] New: enumerate can't work with ref foreach

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

          Issue ID: 16145
           Summary: enumerate can't work with ref foreach
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

enumerate works by returning a tuple of index and element, so e.g.

foreach(i, ref el; r.enumerate) el = 3;

compiles fine but will not do anything to el.

--
Jun 09 2016