D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9085 - allow for iteration of const(V[K]) without casts
Summary: allow for iteration of const(V[K]) without casts
Status: RESOLVED DUPLICATE of issue 9212
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-27 12:09 UTC by Daniel Davidson
Modified: 2013-11-23 08:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Daniel Davidson 2012-11-27 12:09:05 UTC
As described in this thread
http://forum.dlang.org/post/qqouzioewrakuhpoeysy@forum.dlang.org
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 yebblies 2013-11-23 08:11:34 UTC
As far as I can tell...

*** This issue has been marked as a duplicate of issue 9212 ***