Strong types for arithmetic_range_validator

Open
#120 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
cli

Research direction

Start at the arithmetic_range_validator constructor and review the current stable API shown in the issue. Compare the proposed strong-type locations and designated-initializer option, then define the chosen API and its completion criteria before making changes.

Written by the indexing model from the issue text.

Description

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)
Dominant language
C++
Stars
11
Forks
9
Avg merge
2h 33m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seqan/sharg-parser

All issues in seqan/sharg-parser

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.