Streaming transport interfaces: input

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Oct 14 10:19:06 PDT 2010


On 10/14/2010 11:43 AM, Pelle wrote:
> Why is positionable in TransportBase? Should it not be a separate
> interface?

It could.

> Also, shouldn't the reads accept any output range? appendDelim as well.
> This would do away with the two extra versions in the text input.

Interfaces can't have overridable template methods.

> Why does the reads throw on maybe-too-small arrays? I would expect them
> to read at best effort and return 0 if they fail. As they read 0 bytes.

Because small arrays would make it (a) impossible to distinguish between 
no-op and end of file and (b) impossible to read one UTF code point.


Andrei



More information about the Digitalmars-d mailing list