On Thu, Nov 08, 2007 at 10:59:40PM +0100, 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?

it would be cumbersome changing each instance of something like

       ws.os() << ' ';

or

       ws.os() << '\n';
       
in that way. And someone will forgot that and will use one of the
above.

-- 
Enrico

Reply via email to