The extraction operator (>>) reads formatted character data from an input stream and converts it according to the destination variable's type. Unlike scanf format strings, it avoids separate conversion specifiers and allows each input operation to be checked independently. section 6.1
Read and check values incrementally
An istringstream can read a double, integer, string, and another integer in sequence: str >> pi; str >> cats; str >> buffer; str >> mice;. Check str.fail() after each operation to identify the failing value. Consistent input converts correctly; inconsistent input sets the stream's failure state. section 6.1
