C++ Streams and the underlying file descriptor
Dietmar Kuehl
dietmar.kuehl@claas-solutions.de
Sat Apr 1 00:00:00 GMT 2000
Hi,
At 07:05 PM 1/16/00 -0500, Kevin Atkinson wrote:
>The reason I ask is because I need to use posix locks in one of my
>program and I would like to to still be able to use C++ streams however
>I don't want to unnecessary sacrifice portability.
If you want portability and speed (this was one of the reason you
stated for having the stuff implemented in the standard library), you
should use a stream buffer built on top of the POSIX interface. This
would clearly be portable across all POSIX platforms and might even
include features like locking in the stream/stream buffer interface. For
the speed, it could avoid the whole issue of code conversion using the
'codecvt' facet which is done for file streams.
To put it differently: I would strongly prefer if libstdc++ classes do not
include any extensions. Instead, extensions like eg. a POSIX stream and
a corresponding POSIX stream buffer should be part for a complementary
library. Whether there will be such a library shipping with libstdc++ or
a coming from a different source, eg. from < http://www.boost.org/ >, is
a different matter. If you are interested specifically in a POSIX stream
and POSIX stream buffer, just mail me: I have such a beast and will submit
it to Boost.org when I have time to put everything together but I can
sent you the current version.
Regards,
dk
More information about the Libstdc++
mailing list