Re: Advice about deriving class from streambuf ...
Gennaro Prota wrote:
On 12 Jan 2007 05:29:44 -0500, Carl Barron wrote:
Boost has an iostreams library that uses an OOP approach to
constructing a working streambuf and corresponding stream.
If these work it saves a lot of time and energy:)
Except that last time I looked at it it invoked all sorts of undefined
behaviors. Absolutely not recommended.
Such as? I've not studied the actual sources; I have to target
some pretty old compilers, and cannot use Boost in my production
code, but I know that for the most part, code in Boost undergoes
a pretty stiff code review (and the facilities that Boost's
iostream offers are very much what one needs---the interface is
definitly well designed).
Or are you talking about the implementation defined behavior
that everyone doing IO counts on, because the interface (dating
from C) isn't very usable otherwise, and because it is so wide
spread that no compiler would dare break it. (I'm talking here
about assigning an int with a value 0...UCHAR_MAX to a char, and
more generally, using a possibly signed char to contain values
logically in the range 0...UCHAR_MAX.)
--
James Kanze (Gabi Software) email: james.kanze@gmail.com
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]