[Issue 10541] Failure writing to elements of std.range.zip
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 27 13:20:22 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=10541
Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andrej.mitrovich at gmail.com
Severity|normal |major
--- Comment #2 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2014-03-27 21:20:15 CET ---
Re-tagged as a major issue, 'ref' not having an effect is a big issue IMHO.
Simple test-case:
-----
import std.range;
void main()
{
int[] x = [1, 1, 1];
int[] y = [1, 2, 3];
foreach (a, ref b; lockstep(x, y))
b += a;
assert(y == [2, 3, 4]); // ok
foreach (a, ref b; zip(x, y))
b += a;
assert(y == [3, 4, 5]); // fails, it's still [2, 3, 4]
}
-----
Without zip supporting ref access Issue 8155 should not be considered yet.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list