protocol for using InputRanges
Steven Schveighoffer
schveiguy at yahoo.com
Fri Mar 28 03:42:54 PDT 2014
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.
-Steve
More information about the Digitalmars-d
mailing list