Steven Schveighoffer Wrote: > On Fri, 14 Oct 2011 09:02:04 -0400, Kagamin <s...@here.lot> wrote: > > > Steven Schveighoffer Wrote: > > > >> This won't solve the problem. I need inout to be on V, not on the > >> cursor. Essentially, I need cursor to be tail-inout. > > > > Since const is transitive, constness of cursor eventually propagates to > > V. > > I think you misunderstand the problem. I need constness to be applied to > the V, but *NOT* to the cursor. If constness is applied to the cursor, > it's not iterable (i.e. popFront does not work).
the cursor can provide a method, say, dup, which would return it's mutable copy, properly templated on const. foreach(v; dic.values) // doesn't compile? foreach(v; dic.values.dup()) // should work