[Issue 6174] Initialize const fixed-size array in constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 7 13:13:21 PDT 2012


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



--- Comment #7 from bearophile_hugs at eml.cc 2012-10-07 13:01:14 PDT ---
This is an improvement of D.


std.algorithm.copy can't be used to initialize const array fields, but this is
not important:


import std.algorithm: copy;
class Foo {
    const int[3] bar;
    this() {
        auto data = [10, 20, 30];
        foreach (i, d; data) bar[i] = d; // OK
        copy(data, bar[]); // error
    }
}
void main() {}

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