Proposal for SentinelInputRange

Walter Bright newshound2 at digitalmars.com
Thu Feb 28 16:34:21 PST 2013


On 2/28/2013 4:07 PM, Jonathan M Davis wrote:
> But that's with a pointer. You see every ++ there? That would be a popFront
> call, and for most ranges, that would mean checking empty internally if the
> range needs to have a sentinel value on its end, because most ranges will be a
> wrapper around another range, and the only way to know whether you've reached
> their end (and that therefore, front now needs to be the sentinel) is to check
> for empty.

It's trivial to construct a SentinelInputRange that does not do this yet is correct.

> I just don't see how you're going to get a
> performance gain from much of anything other than strings.

I gave you other examples already. We're just going around in circles.



More information about the Digitalmars-d mailing list