A validator that checks whether a number is inside a given range.
More...
#include <seqan3/argument_parser/validators.hpp >
using option_value_type = option_value_t
The type of value that this validator invoked upon.
template<
arithmetic option_value_t>
class seqan3::arithmetic_range_validator< option_value_t >
A validator that checks whether a number is inside a given range.
Template Parameters
On construction, the validator must receive a maximum and a minimum number. The class than acts as a functor, that throws a seqan3::validation_error exception whenever a given value does not lie inside the given min/max range.
int main(int argc, char const ** argv)
{
int myint;
try
{
myparser.parse();
}
{
return -1;
}
return 0;
}
Meta-header for the Argument Parser module .
Argument parser exception that is thrown whenever there is an error while parsing the command line ar...
Definition exceptions.hpp:37
The SeqAn command line parser.
Definition argument_parser.hpp:145
A validator that checks whether a number is inside a given range.
Definition validators.hpp:122
Provides seqan3::debug_stream and related types.
@ standard
The default were no checking or special displaying is happening.
Definition auxiliary.hpp:248
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:37
◆ arithmetic_range_validator() [no-api]
The constructor.
Parameters
[in] min_ Minimum set for the range to test.
[in] max_ Maximum set for the range to test.
◆ get_help_page_message() [no-api]
Returns a message that can be appended to the (positional) options help page info.
Implements validator .
◆ operator()() [1/2] [no-api]
Tests whether cmp lies inside [min
, max
].
Parameters
cmp The input value to check.
Exceptions
◆ operator()() [2/2] [no-api]
template<std::ranges::forward_range range_type>
requires
arithmetic <std::ranges::range_value_t<range_type>>
Tests whether every element in range
lies inside [min
, max
].
Template Parameters
range_type The type of range to check; must model std::ranges::forward_range. The value type must model seqan3::arithmetic .
Parameters
range The input range to iterate over and check every element.
Exceptions
The documentation for this class was generated from the following file: