Boost logo

Boost :

From: Gregory Seidman (gseidman_at_[hidden])
Date: 2001-08-13 13:36:38


Matt Austern sez:
} Daryle Walker wrote:
} > For the file descriptors, why don't you combine the input and output into
} > one streambuf class?
}
} I've written classes that are similar to Nico's, and my preference
} has usually been to do the same thing he did: separate classes for
} input and output.
}
} My reason for doing that is that an input streambuf and an output
} streambuf tend to look very different anyway. A streambuf that
} does both ends up being little more than those two classes smooshed
} together. Mixing input and output on the same stream is complicated
} and restricted; on balance, I didn't think that the limited gain
} was worth the extra complexity.
}
} I wouldn't particularly mind having a combined input/output streambuf,
} but I'd rather see it in addition to the two separate classes rather
} than as a replacement. I'd like to have the simple classes for the
} common cases.
}
} --Matt

I'm not overly familiar with the details of streambuf and the like
(otherwise I would have written fdstream myself some time ago), but it's
worth mentioning that a combined streambuf would be desirable. In
particular, while most file descriptors are unidirectional, sockets are
bidirectional and would be most useful wrapped in a single iostream.

--Greg


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk