On Thursday, 26 January 2017 at 11:32:09 UTC, ZombineDev wrote:

Not sure if this is a bug in isInputRange or foreach, but they should work consistently.

Copy/paste from primitives.d:

template isInputRange(R)
{
    enum bool isInputRange = is(typeof(
    (inout int = 0)
    {
        R r = R.init;     // can define a range object
        if (r.empty) {}   // can test for empty
        r.popFront;       // can invoke popFront()
        auto h = r.front; // can get the front of the range
    }));
}

Reply via email to