http://d.puremagic.com/issues/show_bug.cgi?id=2411
--- Comment #6 from David Simcha <dsim...@yahoo.com> 2012-01-01 13:44:46 PST --- (In reply to comment #5) > My patch requires explicit 'ref'. > > void main() { > S s; > // foreach( element; s.tupleof) // doesn't work > foreach(ref element; s.tupleof) // OK > element = 2; > assert(s.foo == 2); > (In reply to comment #5) > My patch requires explicit 'ref'. > > void main() { > S s; > // foreach( element; s.tupleof) // doesn't work > foreach(ref element; s.tupleof) // OK > element = 2; > assert(s.foo == 2); > } It seems to me like the only logical way to do this is to require explicit ref. The semantics should be the same as foreach over ranges. Nice work. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------