[Issue 8878] std.range is not pure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 23 12:13:54 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8878



--- Comment #2 from bioinfornatics <bioinfornatics at gmail.com> 2012-10-23 12:13:51 PDT ---
In first thanks jonathan to your answer.
Code below fail both when using pure with dmd/ldc  dmdfe 2.060 =>
http://dpaste.dzfl.pl/65efd36e

___________________________________________
import std.range;
import std.stdio;

pure uint square( in int[] x, in int[] y ){
    uint result = 0;
    foreach( item; zip( x, y ) )
        result += item[0] * item[1];
    return result;
}

int main(){
    int[3] a = [0,1,2];
    int[3] b = [1,2,3];
    writefln( "Square of %s with %s give %u", a, b, square( a, b ) );
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list