Streaming library

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Oct 14 11:46:21 PDT 2010


On 10/14/10 13:21 CDT, Steven Schveighoffer wrote:
> On Thu, 14 Oct 2010 13:42:53 -0400, Denis Koroskin <2korden at gmail.com>
> wrote:
>> Besides, typed stream needs to be built of top of buffered stream (not
>> an unbuffered one). E.g. T might be a big struct, and Stream doesn't
>> provide a guaranty that it can ready exactly N bytes (think about
>> socket stream).
>
> Hm... you are right, you'd have to buffer at least one T in order for
> this to work. That kind of sucks. This rules out wchar and char. Maybe
> it's better to allow all T's where T.sizeof is 1 (this rules out pointer
> types anyways). Andrei?

I was thinking of throwing if the size of data read is not divisible by 
the item size. This makes it unlikely to read large data from a burst 
device like a socket, but that's expected.

Andrei


More information about the Digitalmars-d mailing list