stream == range ? [Sliding window]
Dmitry Olshansky via Digitalmars-d
digitalmars-d at puremagic.com
Sun May 31 14:34:18 PDT 2015
On 01-Jun-2015 00:13, Andrei Alexandrescu wrote:
> On 5/31/15 10:50 AM, Dmitry Olshansky wrote:
>> 1. There must be a way to look at underlying buffer w/o copying anything.
>
> bulkRead would be useful for unbuffered streams. The input range
> interface requires a 1-element (at least) buffer. Buffered ranges would
> indeed need more optional primitives. -- Andrei
Then if unbuffered stream is an InputRange and it would by "default"
fallback to reading one byte (T.sizeof but anyhow) at a time .. sounds
scary. Might be cute but never what we'd want.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list