www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9085] New: allow for iteration of const(V[K]) without casts


           Summary: allow for iteration of const(V[K]) without casts
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dbdavidson yahoo.com

--- Comment #0 from Daniel Davidson <dbdavidson yahoo.com> 2012-11-27 12:09:05
PST ---
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).

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 27 2012