protocol for using InputRanges

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Mar 28 17:14:39 PDT 2014


On 3/28/14, 3:42 AM, Steven Schveighoffer wrote:
> On Thu, 27 Mar 2014 20:25:56 -0400, Walter Bright
> <newshound2 at digitalmars.com> wrote:
>
>> On 3/27/2014 2:31 PM, Steven Schveighoffer wrote:
>>> Adding range primitives on top of a stream does not make sense.
>>
>> Are ready to implement a parallel universe of stream based algorithms
>> to go alongside all the range based ones and be ready to constantly
>> justify that to everyone?
>
> Not necessary. You just need to implement one range on top of a buffered
> stream, and then it works with all other algorithms that accept input
> ranges.
>
>> I'm also curious what a generic read() should do when the stream is
>> empty.
>
> Returns 0 elements read.

It increasingly seems to me we need to do this. -- Andrei



More information about the Digitalmars-d mailing list