[Issue 10009] foreach_reverse and AA.byKey/byValue

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Sep 25 09:47:00 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=10009

--- Comment #13 from bearophile_hugs at eml.cc ---
(In reply to hsteoh from comment #12)
> It *is* possible to implement a reverse traversal in AA's. I'm just not sure
> it's a good idea (it'd need to allocate memory in order to traverse the
> linked-lists in reverse order).

Associative array pairs have a deterministic but undefined order. So what's the
reverse of an undefined order? A simple solution is to turn foreach_reverse on
an associative array in a compile-time error.

--


More information about the Digitalmars-d-bugs mailing list