I have a flimsy understanding of how/why istream can be used in conditionals. I have read this question:(Why istream object can be used as a bool expression?).
I don't understand why this compiles without error…
while (cin >> n) {
// things and stuff
}
…while this fails to compile (message error: invalid operands to binary expression ('int' and '__istream_type' (aka 'basic_istream<char, std::char_traits<char> >'))
)
while (true == (cin >> n)) {
// things and stuff
}