[Issue 5170] New: std.algorithm.copy "works" for non-assignable ranges

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 5 10:04:25 PDT 2010


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

           Summary: std.algorithm.copy "works" for non-assignable ranges
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2010-11-05 10:03:26 PDT ---
The following code compiles and runs (??????)

import std.algorithm;

struct DummyRange {
    int front() { return 1; }
    void popFront() {}
    enum bool empty = false;
}

void main() {
    auto arr = [1,2,3];
    DummyRange dummyRange;
    copy(arr, dummyRange);
}

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