[Issue 14373] New: std.range.refRange doesn't work on mere input ranges

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Mar 29 04:28:23 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14373

          Issue ID: 14373
           Summary: std.range.refRange doesn't work on mere input ranges
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: ag0aep6g at gmail.com

struct R
{
    @property int front() {return 0;}
    void popFront() {empty = true;}
    bool empty = false;
}
void main()
{
    import std.range: refRange;
    R r;
    refRange(&r).popFront();
    assert(r.empty); /* fails */
}

Pull request incoming.

--


More information about the Digitalmars-d-bugs mailing list