Le 26 janv. 2011 à 22:10, Enrico Forestieri a écrit :

> On Wed, Jan 26, 2011 at 09:52:39PM +0100, Jean-Marc Lasgouttes wrote:
> 
> Yep, but an explicit method also helps in the line counting task,
> otherwise YA method has to be called to get that info. Currently it
> is done such as "lines = os.canBreakLine() ? 3 : 2;" just before
> outputting the thing, and it could be "lines = os.breakLine();"
> and then "lines += number_of_newlines_in_sight;", as already done.

[thinking aloud] or a os.countLines() that counts the number of \n output
since the previous call to os.countLines()? This looks like something not 
too difficult to implement...

Of course, we have to be careful with std::endl.

JMarc

Reply via email to