anonymous static array

David d at dav1d.de
Wed Mar 21 06:13:38 PDT 2012


Am 21.03.2012 11:51, schrieb Stephan:
> Hi,
>
> I have an associative array with strings as keys and static arrays as
> values. When I access a new key, it gives me Range Error, so I think I
> should initialise the associative array, but how?
>
> here is the code that fails:
>
> int[100][string] counts;
> counts["some_key"][20]++;
> // core.exception.RangeError at freqSpec(26): Range violation
>
>
> Thanks,
>
> Stephan
>

You can (or even have to?) do it in a static ctor.


More information about the Digitalmars-d-learn mailing list