Init const fixed-sixed array in ctor

bearophile bearophileHUGS at lycos.com
Fri Jun 17 17:09:36 PDT 2011


This is a known bug, right?


struct Foo {
    const char cc;
    const char[1] array;
    this(char c) {
        cc = c;       // OK
        array[0] = c; // Error: this.array[0] isn't mutable
    }
}
void main() {}


Bye,
bearophile


More information about the Digitalmars-d-learn mailing list