On Wednesday, 29 April 2020 at 08:34:53 UTC, Ogi wrote:
struct R {}
int front(R r) { return 42; }
void popFront(R r) {}
bool empty(R r) { return false; }

void main() {
    import std.range.primitives : isInputRange;
    static assert(isInputRange!R);
}

Error: static assert:  `isInputRange!(R)` is false

What’s going on here?


The template IsInputRange is in the std.range.primitives module, and thus can't see the front, popFront and empty definitions in your module.

--
  Simen

Reply via email to