[Issue 6797] Fake changes to enum array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 2 10:33:40 PST 2012


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


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-12-02 10:33:38 PST ---
There is no "hole" here, what you get here are separate arrays which are
allocated for you wherever you use them. For example:

import std.stdio;

void main()
{
    enum int[] array = [1, 2];

    foreach (i, _; array)
        writeln(&array[i]);

    foreach (i, ref _; array)
        writeln(&array[i]);
}

Prints:

972FE0
972FD4

972FB0
972FA4

Those are two separate arrays.

-- 
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