value() retrieves the object stored in a std::optional. Check whether the optional contains a value first; calling value() when it is empty throws an exception. section 3.1.2
Reading a guess
A number-guessing loop uses read_number to return an optional integer. After the loop confirms a guess exists, guess.value() retrieves it for comparison or output; an empty optional lets the player give up. section 3.1.2
