Currently I\'m self-learning C++ Primer 5th. Here comes something I\'m not sure. (I couldn\'t find the exact relevant question on F.A.Q).
Consider this while loop:>
does std::cin read input into value first then test the validation of std::cin, or test std::cin first then decide whether to read into 'value'
cin first tries to read an int from the standard input, if cin is in a good state: if it fails to, it will set the stream to a bad state; regardless of the operation done, it will return the stream itself (i.e. the "left operand" -- cin), that will allow you to check for success or failure.
If you wanted to explicitly test the validity of the stream first and only then try to read the value, you would have:
while (cin && cin >> value)
but it's pretty redundant, since, as I've told you, cin will not even try to read value if it's already in a bad state.