C++11 provides eight functions (Fig. 19.13; from the <string>
header) for converting string
objects to numeric values. Each function attempts to convert the beginning of its string
argument to a numeric value. If no conversion can be performed, each function throws an invalid_argument
exception. If the result of the conversion is out of range for the function’s return type, each function throws an out_of_range
exception.