protocol for using InputRanges
monarch_dodra
monarchdodra at gmail.com
Sat Mar 29 02:06:43 PDT 2014
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?
More information about the Digitalmars-d
mailing list