www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14373] New: std.range.refRange doesn't work on mere input

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 puremagic.com
          Reporter: ag0aep6g 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.

--
Mar 29 2015