Can the order in associative array change when keys are not midified?
Andrej Mitrovic via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Jan 1 08:56:12 PST 2015
On 1/1/15, Peter Alexander via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:
> The order is unspecified, but an iteration must iterate in *some*
> order. The question (if I've understood it correctly), is whether
> that order of iteration changes when the keys aren't changed.
Hmm yeah, that definitely wasn't ever specified. But remember that
there is also a .rehash() method. It's a bit tricky to work with AAs
for sure..
> The spec doesn't say anything about this, although I would expect
> in practice that the order will not change.
>
> I've added a bug to track this omission from the spec:
> https://issues.dlang.org/show_bug.cgi?id=13923
Thanks.
More information about the Digitalmars-d-learn
mailing list