[Issue 5561] New: Problem with map() that returns array contents

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 10 14:31:14 PST 2011


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

           Summary: Problem with map() that returns array contents
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2011-02-10 14:28:48 PST ---
import std.algorithm;
void main() {
    int[] a1 = [10, 20];
    auto r1 = map!((int k){ return a1[k]; })([0, 1]); // OK
    double[] a2 = [10.5, 20.5];
    auto r2 = map!((int k){ return a2[k]; })([0, 1]); // Access Violation
}

-- 
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