Andre Poenitz wrote:
On Thu, Nov 01, 2007 at 07:37:26PM +0100, Abdelrazak Younes wrote:
Abdelrazak Younes wrote:
Andre Poenitz wrote:
On Wed, Oct 31, 2007 at 06:25:31PM +0100, Jean-Marc Lasgouttes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:

If somebody use the docstream with latin8 character we will have bugs
for sure.
How could we forbid 8bit chars to operator<<? By implementing a
private version?
Sort of. Declare but not implement it.
Problem is... that it is already implemented:
inline
odocstream & operator<<(odocstream & os, char c)
{
    os.put(c);
    return os;
}
Putting an BOOST_ASSERT(false) here or throwing an exception would achieve what you want JMarc.
But we cannot do that right now because this operator is used by mathed. Andre', I think the next big thing in mathed is to move to unicode and to remove any font related business from there.

WriteStream & operator<<(WriteStream & ws, char c)
{
        if (ws.pendingSpace()) {
                if (isAlphaASCII(c))
                        ws.os() << ' ';
                ws.pendingSpace(false);
        }
        ws.os() << c;
        if (c == '\n')
                ws.addlines(1);
        return ws;
}

If that's the only instance using it this can easily be changed to

                        ws.os().put(char_type(c))

or such, couldn't it?

As Enrico pointed out, that's not the single instance.

Abdel.

Reply via email to