On Tue, Nov 06, 2012 at 03:36:54AM +0200, Andrei Alexandrescu wrote: > On 11/6/12 3:06 AM, H. S. Teoh wrote: > >I've already given a number of non-trivial examples of transient > >forward ranges, and apparently deadalnix has also encountered the > >same issue. > > I'd like to build more of this argument. I pointed out that your range > is actually defining .dup, not .save. I think an argument can be made > that forward ranges with transient .front do not qualify as forward > ranges, seeing as a forward range is modeled after a list that > actually has data sitting in memory. [...]
I suppose you could argue that way. But that still doesn't solve the problem of std.array.array with input ranges. Making std.array.array require forward ranges seems to defeat its purpose, to me. So even if you get rid of transience in forward ranges, you still need to make that distinction with input ranges. Which still requires large-scale code changes to existing Phobos algorithms. And which still requires some sort of complication to the existing range code. T -- Music critic: "That's an imitation fugue!"