[Issue 16255] std.algorithm.iteration.each on opApply doesn't support ref

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Feb 5 14:16:10 PST 2017


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

b2.temp at gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |b2.temp at gmx.com
         Resolution|FIXED                       |---

--- Comment #6 from b2.temp at gmx.com ---
Is this supposed to work now ?


void main()
{
    int[][] arr = void;
    arr.length = 10;

    version(all)
    {
        import std.algorithm.iteration : each;
        arr.each!((ref a){a.length = 10; a[] = -1;});
    }
    else
    {
        foreach(ref a; arr)
        {
            a.length = 10;
            a[] = -1;
        }
    }
}

--


More information about the Digitalmars-d-bugs mailing list