Seems when creating your own ranges they can't be a class.
Must be a struct or Segmentation fault (core dumped) will follow.

This works as long as Test is a struct.

struct Test
{
  @property int front()
  {
    return 2;
  }

  void popFront()
  {
  }

  enum bool empty = false;
};

static assert(isInputRange!Test);

void mainx(){
  Test x;
  writeln(x.take(1));
}

Reply via email to