Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lexical cast validation for hffix::message_reader #24

Open
jamesdbrock opened this issue Oct 7, 2019 · 0 comments
Open

Lexical cast validation for hffix::message_reader #24

jamesdbrock opened this issue Oct 7, 2019 · 0 comments

Comments

@jamesdbrock
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant