front stability

jmh530 via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 30 07:59:11 PDT 2016


On Thursday, 30 June 2016 at 14:17:22 UTC, Steven Schveighoffer 
wrote:
>
> Jack Stouffer has created a PR to formalize this.
>
> Please comment if you have objections (the group that argued 
> for current generate behavior was absent from this post that 
> was meant to be a debate). I think this is the right thing to 
> do.

It looks like this is just documentation changes. This really 
doesn't prevent anyone from making a Range that violates front 
stability. For instance, suppose isInputRange is changed so that

auto h = r.front; // can get the front of the range

becomes

auto h = r.front; // can get the front of the range
auto j = r.front;
assert(h == j);  //ensure front stability

This doesn't seem to work for the map example above, but could it 
be adapted so that it does?


More information about the Digitalmars-d mailing list