http://d.puremagic.com/issues/show_bug.cgi?id=4707
Summary: auto ref for foreach loops
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from David Simcha <[email protected]> 2010-08-21 19:31:14 PDT ---
The following should be possible, with x being ref if possible and non-ref
otherwise. I've toyed with the possibility of adding opApply support to some
stuff in std.range and std.algorithm and this is a blocker for doing it at all
properly.
void main() {
foreach(auto ref x; [1, 2]) {}
}
test9.d(2): basic type expected, not auto
test9.d(2): no identifier for declarator int
test9.d(2): found 'auto' when expecting ';'
test9.d(2): found ';' when expecting ')'
test9.d(2): found ')' when expecting ';' following statement
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------