[Issue 12007] New: cartesianProduct does'nt work with immutable ranges
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 26 23:19:29 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12007
Summary: cartesianProduct does'nt work with immutable ranges
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: camille.brugel at laposte.net
--- Comment #0 from matovitch <camille.brugel at laposte.net> 2014-01-26 23:19:25 PST ---
The following code does not compile because Zip cannot modify the second
tuple's member since it is immutable :
import std.algorithm;
import std.stdio;
void main()
{
immutable int[] A = [1,2,3];
immutable int[] B = [4,5,6];
auto AB = cartesianProduct(A,B);
writeln(AB);
}
The same thing appends here :
import std.stdio;
import std.range;
void main() {
writeln(zip([1,2,4,3], take(Repeat!(immutable(int))(2), 4)));
}
Is this a normal behaviour ?
--
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