You could use [`std.range.InputRangeObject`](http://dlang.org/phobos/std_range.html#.InputRangeObject) instead. That always returns an object.