Saaa:

> struct S
> {
>   int i;
> }
> S[char[]] aa;
> void main() {
>   aa["test"].i = 10;
> }
> 
> Error: ArrayBoundsError
> D1.046

Try:

struct S { int i; }
S[char[]] aa;

void main() {
    aa["test"] = S(10);
}

In theory a Sufficiently Smart Compiler is able to optimize that code well.

Bye,
bearophile

Reply via email to