Streams: an open discussion

surferjeff at excite.com surferjeff at excite.com
Sat Feb 25 22:37:36 PST 2006


The interface for InputStream and OutputStream is huge.  I often have to create
my own streambufs in C++, which only requires implementing about 5 methods.  If
I want to write my own class that implements InputStream, then I have to
implement about 50 methods, and another 50 if I want to implement OutputStream
too!

It would useful if there were smaller interfaces.  For example, a read() method
and eof() for input, and that's it.  Then have a util class that takes one of
these small interfaces and implements the full 50 methods in the bigger
interface.

Yes, I could do this in my own code, but I think many people will have to
re-invent this wheel in D, and each re-invention will be different and not
interchangeable.





More information about the Digitalmars-d mailing list