It would be nice if the hffix::details::atoi and hffix::details::atou functions verified that the ASCII which they are converting to a number is in fact digits 0-9.
But how to do that elegantly?
Don't want to complicate the return type with std::optional, that would require ugliness and C++17.
Don't want to throw an exception, the library design is that we only throw exceptions for mistakes in API usage, not for some garbage that we got over the network.
It would be nice if the
hffix::details::atoi
andhffix::details::atou
functions verified that the ASCII which they are converting to a number is in fact digits0-9
.But how to do that elegantly?
Don't want to complicate the return type with
std::optional
, that would require ugliness and C++17.Don't want to throw an exception, the library design is that we only throw exceptions for mistakes in API usage, not for some garbage that we got over the network.