foreach for string[string]AA

Anton Pastukhov via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 28 07:15:00 PST 2017


I can't see the logic in AA foreach order. Consider this code:

```
void main() {
     string[string] test = [
         "one": "1",
         "two": "2",
         "three": "3",
         "four": "4"
     ];

     import std.stdio:writeln;

     foreach(k, v; test) {
         writeln(k);
     }
}

Output:
three
two
one
four

I was sure output should be
one
two
three
four


More information about the Digitalmars-d-learn mailing list