digitalmars.D - Is an int[int] associative array always sorted?
- Francis (3/3) Feb 19 2005 Hello, D guys!
- Unknown W. Brackets (7/14) Feb 19 2005 I don't believe it is. This was discussed earlier, actually, and you
Hello, D guys! Is an integer-indexed associative array always sorted in a foreach loop? -Francis
Feb 19 2005
I don't believe it is. This was discussed earlier, actually, and you can use: foreach (int key; array.keys.sort) array[key]; Or similar. I'm pretty sure the order, unsorted, would be implementation-specific and shouldn't be depended on.... -[Unknown]Hello, D guys! Is an integer-indexed associative array always sorted in a foreach loop? -Francis
Feb 19 2005