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: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from matovitch <[email protected]> 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: -------

Reply via email to