Bug 9085 – allow for iteration of const(V[K]) without casts

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-27T12:09:00Z
Last change time
2013-11-23T08:11:34Z
Assigned to
nobody
Creator
dbdavidson

Comments

Comment #0 by dbdavidson — 2012-11-27T12:09:05Z
As described in this thread http://forum.dlang.org/post/[email protected] iteration on associative arrays and certain features that use iteration, like getting the length, require a deep cast away of const. Part of the reason is the keys are copied. This is probably unnecessary and a better approach would be to have foreach(k,v;aa) assume that k is a ref const(K).
Comment #1 by yebblies — 2013-11-23T08:11:34Z
As far as I can tell... *** This issue has been marked as a duplicate of issue 9212 ***