Minor std.stdio.File.ByLine rant

Steven Schveighoffer schveiguy at yahoo.com
Fri Feb 28 15:27:10 PST 2014


On Fri, 28 Feb 2014 16:12:26 -0500, H. S. Teoh <hsteoh at quickfur.ath.cx>  
wrote:

> According to a strict interpretation of the range API, it is invalid to
> call any range method before you call .empty, because if the range turns
> out to be empty, calling .front or .popFront is undefined. So it is
> sufficient to implement lazy construction for .empty alone. All other
> cases *should* break anyway. :)
>
> Once you have that, then what you're proposing is no different from
> mine, in essence.

Yes, this is true. So, one can specifically define empty() and let the  
rest go to alias this.

I think such a range would be a good phobos addition.

-Steve


More information about the Digitalmars-d mailing list