Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2007-06-18 10:37:43

Sebastian Redl wrote:
> Hi,
> A few weeks ago, a discussion that followed the demonstration of the
> binary_iostream library made me think about the standard C++ I/O and
> what I would expect from an I/O model.
> Now I have a preliminary design document ready and would like to have
> some feedback from the Boost community on it.
> The document can be found here:

Nice to hear someone is working on this. I really think that C++ needs a
whole new IO system. My main complaints about iostreams are:

-> Bad performance: It's really hard to get good performance for a
conforming iostream implementation. Implementors need to start hacking
around with watermarking and other tricks. No virtual calls for each
character insertion, please. Stringstream is a bad substitute for
sprintf. So the new IO needs to be designed from the ground as a high
performance IO system.

-> Big size: Even if iostreams are not used in the application (say we
are using printf), the runtime and cout/cin initialization guarantees
have some size overhead. That's why some embedded library vendors offer
disabling iostreams from their libraries at compilation time.

-> Hard formatting: printf/scanf are much easier to use and they don't
need several hundred of function calls to do their job. The operator<<
overloading is also a problem if each call needs some internal locking.
A formatting syntax that can minimize the locking needs would be a good
choice. I would be really happy with a type-safe printf (variadic
templates to the rescue).



Boost list run by bdawes at, gregod at, cpdaniel at, john at