#include "math_extern.h"
#include "debug.h"
+#include <algorithm>
+
MathMLStream::MathMLStream(std::ostream & os)
: os_(os), tab_(0), line_(0), lastchar_(0)
WriteStream & operator<<(WriteStream & ws, char const * s)
{
ws.os() << s;
- for ( ; *s ; ++s) {
- if (*s == '\n')
- ++ws.line();
- }
+ ws.line() += std::count(s, s + strlen(s), '\n');
return ws;
}