kdbgstream::operator<<({,u}char)

Bo Thorsen bo at sonofthor.dk
Tue Nov 12 12:31:51 GMT 2002


On Tuesday 12 November 2002 13:20, David Faure wrote:
> On Tuesday 12 November 2002 13:06, Bo Thorsen wrote:
> > I can understand the check for 0, but I disagree about the '\n'. A
> > flush happens upon endl, not on '\n'.
> >
> > std::cerr << "Something\n";
> > std::cerr << "Something" << std::endl;
> >
> > The C++ standard says that the second flushes the stream, the first
> > doesn't. Does the kdDebug stream not follow this?
>
> No. Apparently many developers are too lazy to write endl, so they use
> \n instead :)

Are you sure it's not just because they don't know the difference?

Anyway, since this is only debug output, I assume it does make sense here 
to get it out asap, so the buffering shouldn't really happen.

I just always assumed KDE followed the C++ standard, so it surprised me.

Bo.

-- 

     Bo Thorsen                 |   Praestevejen 4
     Senior Software Engineer   |   5290 Marslev
     Klarälvdalens Datakonsult  |   Denmark





More information about the kde-core-devel mailing list