http://d.puremagic.com/issues/show_bug.cgi?id=10130
Summary: map of iota with const step
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2013-05-21 15:22:59 PDT ---
In this case map!() can't be applied on a iota():
import std.algorithm: map;
import std.range: iota;
void main() {
const step = 2;
iota(0, 10, step).map!(i => i);
}
DMD 2.063beta5 gives:
...\dmd2\src\phobos\std\algorithm.d(482): Error: cannot modify struct
result._input Result with immutable members
...\dmd2\src\phobos\std\algorithm.d(390): Error: template instance
test.main.MapResult!(__lambda2, Result) error instantiating
test.d(5): instantiated from here: map!(Result)
test.d(5): Error: template instance test.main.map!(__lambda2).map!(Result)
error instantiating
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------