How is “std::cin>>value” evaluated in a while loop?
问题 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: while(std::cin>>value){...} \\value here was defined as int. The text book says: That expression reads the next number from the standard input and stores that number in value. The input operator (§ 1.2, p. 8) returns its left operand, which in this case is std::cin. This condition, therefore, tests std::cin.When we use an istream as a