No. I meant to evaluate eof() only, while still taking cin input. The comma operator evaluates both expressions but takes only the rightmost as the result.
Code:
int i = 0;
while (i++, i != 6) {
cout << i; //outputs 12345
}
I could probably place my code inside a do statement and not do that comma thing, but the result will be the same. The problem seems to be that when continue executes the stream still contains whatever input was there and that caused the failbit to be set.
Hence my tries with ignore() and gcount(). Ignore() works when I feed it with a literal integer representing the exact size of the input that causes the failbit.
Code:
($ is my prompt)
$ 1
//works fine
$ bord
// works fine if I introduce cin.ignore(4); just before continue.
//for some reason I cannot understand, it doesn't when i pass cin.gcount() as an argument to ignore()