
20 Jun
2007
20 Jun
'07
7:32 a.m.
Steven Siloti wrote:
Streaming I/O could be done with iterators. Conceptually streams can be thought of as simply being specialized iterators with different syntax. For example, a socket class would present a pair of iterators, one Input Iterator and one Output Iterator (or maybe just a single Forward Iterator?). They would be theoretically never-ending but the Input Iterator would end up equal to some end iterator when the socket has been closed and there is no further data available.
Short question: Wouldn't you need to handle block transfers with some "regular" function anyway , since you do not want to fetch each byte via an iterator dereference? Or do you assume buffering, etc within the iterator? Cheers, /Marcus