Skip to content

Strong types for arithmetic_range_validator #120

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

Open
eseiler opened this issue Sep 6, 2022 · 0 comments
Open

Strong types for arithmetic_range_validator #120

eseiler opened this issue Sep 6, 2022 · 0 comments

Comments

@eseiler
Copy link
Member

eseiler commented Sep 6, 2022

Cuurent stable API:

    arithmetic_range_validator(option_value_type const min_) :
        min{min_},
        max{std::numeric_limits<option_value_t>::max()},
        valid_range_str{"[" + std::to_string(min_) + "," + std::to_string(max_) + "]"}
    {}

Todo:
strong types, e.g. greater_than, less_than, etc. in the constructor can help to increase readability. We need to see how they can be implemented:

  • strong types sharg::greater_then (flies around in the main namespace..)
  • strong types sharg::arithmetic_range_validator::greater_then (is very long...)
  • designated initialisers sharg::arithmetic_range_validator{.greater_then = 3} (not sure if possible)
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