Summary: isOutputRange is true for ranges which can't be output
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos

--- Comment #0 from Jonathan M Davis <> 2010-09-19 03:39:49 
PDT ---
This compiles:

import std.range;

struct Range
    @property bool empty()
        return true;

    @property int front()
        return 7;

    void popFront()

    @property Range save()
        return this;

void main()
    static assert(isInputRange!(Range));
    static assert(isOutputRange!(Range, int));

It shouldn't. You can't ever assign to front. I believe that the problem is
that this portion of put() ends up being compiled in:

static if (is(typeof(r.front = e, r.popFront())))
    r.front = e;

since putting static assert(0); in that portion of put() causing the
compilation to fail.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to