protocol for using InputRanges

monarch_dodra monarchdodra at gmail.com
Sun Mar 30 13:31:02 PDT 2014


On Saturday, 29 March 2014 at 09:06:45 UTC, monarch_dodra wrote:
> On Saturday, 29 March 2014 at 00:14:40 UTC, Andrei Alexandrescu 
> wrote:
>> It increasingly seems to me we need to do this. -- Andrei
>
> Question: Should this new restriction only be applied to 
> *Input*Ranges? If so, then it might make more sense.
>
> Ranges that also satisfy the *Forward* interface (which has 
> save), or specifically, the *Output* interface (that doesn't 
> even have empty) should not have this obligation. In 
> particular, output ranges *write*, so usually can't even buffer 
> data.
>
> *Input*-only Ranges are the ones that are usually implemented 
> over streams, and that are most subject to the "test empty" 
> issue too, so they are the ones that need this restriction.
>
> Could this maybe be a good solution for everyone?

Did this conversation die the instant I actually had something 
smart to say?

@andralex, @WalterBright ? Thoughts?


More information about the Digitalmars-d mailing list