Closed jhlegarreta closed 5 years ago
The ato[if] functions do not provide mechanisms for distinguishing between 0 and the error condition where the input can not be converted.
ato[if]
0
std::sto[id] provides exception handling and detects when an invalid string attempts to be converted to an [integer|double].
std::sto[id]
ato[if]()
The use of ato[if] in code can cause it to be subtly broken. ato[if] makes two very big assumptions indeed:
In agreement with: http://review.source.kitware.com/#/c/23738/
Great, thanks @jhlegarreta!
The
ato[if]
functions do not provide mechanisms for distinguishing between0
and the error condition where the input can not be converted.std::sto[id]
provides exception handling and detects when an invalid string attempts to be converted to an [integer|double].ato[if]()
The use of
ato[if]
in code can cause it to be subtly broken.ato[if]
makes two very big assumptions indeed:In agreement with: http://review.source.kitware.com/#/c/23738/