Wrong lowering for a[b][c]++

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Mar 21 11:56:47 PDT 2012


On 3/21/12, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
> 	int[string][int] map;
> 	map["abc"] = int[int].init;
> 	map["abc"][30] = 123;

I think you meant:

    int[int][string] map;
    map["abc"] = (int[int]).init;
    map["abc"][30] = 123;

You can however init with null if the value is a hash:

    int[int][string] map;
    map["abc"] = null;
    map["abc"][30] = 123;

But otherwise I agree it would be nice if there was a shortcut for this.


More information about the Digitalmars-d mailing list