What's the iterator-correspondence to * then? With a /-behaviour of the line iterator
foreach(Stdio.stdin->line_iterator();; string x) write("%s\n", x);
adds an extra newline to the input. It's *not* behaving like / followed by *. That makes the correspondence between line_iterator and / pretty useless, in my opinion.
Anyway, there's no need to kill each other for this. I think the gets way is the most commonly useful variant, but we could have more than one iterator if you really think some different behaviour is also useful.
/ Niels Möller ()
Previous text:
2002-12-31 00:45: Subject: stdin->line_iterator
No, there is nothing especially natural about including the ending new line. / and * are symmetric on strings the iterator should be a / equivalent. I find that symmetry natural and beautiful.
/ Peter Bortas