Boost logo

Boost :

From: bill_kempf (williamkempf_at_[hidden])
Date: 2001-12-21 10:59:48


--- In boost_at_y..., "mfdylan" <dylan_at_m...> wrote:
> --- In boost_at_y..., "bill_kempf" <williamkempf_at_h...> wrote:
> >
> > There's no evidence that a binary_stream need to be inefficient.
> In
> > fact the majority of overhead in iostreams comes from locales and
> > formatting facilities, both of which would not exist in a
> > binary_stream. I'd be willing to bet that we could develop a
> > binary_stream that was as efficient as a lower level abstraction,
> and
> > there's a lot of power that comes from such a design. For
instance
> > it becomes quite easy to define inserters and extractors for
> > arbitrary types, allows for pluggable converters for native
> > representations, XDR representations, etc.
> >
> That's an interesting idea, mine doesn't allow pluggable convertors.
> Maybe a templated convertor would be more sensible?
> How useful would a "native representation" be?

A template argument is a form of a pluggable convertor to my mind. :)

Native respresentations are extremely useful. In fact, I use native
formatted binary files all the time, while I need a portable
representation only rarely (and usually can get by with text in that
case). An XDR converter or other converters would be nice, but are
hardly necessary for a binary_stream library. (They will be
necessary for a socket library using a binary_stream library, though.
That's why I said you need to step back and view this as a seperate
library and not design it adhoc because of a perceived need in a
socket library.)

Bill Kempf


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