Juergen Spitzmueller wrote:
Enrico Forestieri wrote:
It also doesn't work on Windows and FreeBSD, for example. I think it
would be embarrassing explaining it, as this would imply recognizing a
basic ignorance about C++, and this should not be the case.
You refer to my first or my second patch? If to the latter, please don't
hesitate. I'm well aware of my basic ignorance about C++. If you agree my
second patch would be a reasonable and working compromise, I'd propose to
apply this, because it is safer than yours, IMHO.
I apply a combination of your two patch Juergen. Enrico might think this
is due to ignorance about C++ but this is just ignorance about a bug in
the odocstream. See comment in docstream.h:
/** Base class for UCS4 output streams.
If you want to output a single UCS4 character, use \code
os.put(c);
\endcode, not \code
os << c;
\endcode . The latter will not output the character, but the code point
as number. This is because we can't overload operator<< (our character
type is not a real type but a typedef). Narrow characters of type char
can be output as usual.
*/
typedef std::basic_ostream<char_type> odocstream;
Enrico's patch might be needed for platform were char is unsigned,
dunno. But I maintain the assertion is correct. We should also put an
assertion here:
inline
odocstream & operator<<(odocstream & os, char c)
{
os.put(c);
return os;
}
Abdel.