This shows a limitation of the D type system:

import std.algorithm: copy;
immutable int[2] data;
static this() {
    foreach (i, x; [10, 20]) data[i] = x; // OK
    data[] = [10, 20]; // OK
    [10, 20].copy(data[]); // Error.
}
void main() {}


Bye,
bearophile

Reply via email to