On Fri, 28 Feb 2014 16:12:26 -0500, H. S. Teoh <[email protected]>
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