arg_router
1.4.0
C++ command line argument parsing and routing
|
#include <arg_router/policy/min_max_value.hpp>
Public Types | |
using | value_type = ValueType |
using | less_than_compare = LessThanCompare |
Public Member Functions | |
constexpr | min_max_value_t (std::optional< value_type > min, std::optional< value_type > max, less_than_compare compare=less_than_compare{}) noexcept |
constexpr const less_than_compare & | comp () const noexcept |
template<typename InputValueType , typename... Parents> | |
void | validation_phase (const InputValueType &value, [[maybe_unused]] const Parents &... parents) const |
Provides inclusive minimum and maximum values for a parsed value.
By default operator<
is used for comparisons, but can be overridden.
ValueType | Minimum and maximum value type |
LessThanCompare | Less than comparator type |
Definition at line 22 of file min_max_value.hpp.
using arg_router::policy::min_max_value_t< ValueType, LessThanCompare >::less_than_compare = LessThanCompare |
Less than comparator type.
Definition at line 28 of file min_max_value.hpp.
using arg_router::policy::min_max_value_t< ValueType, LessThanCompare >::value_type = ValueType |
Value type.
Definition at line 26 of file min_max_value.hpp.
|
inlineconstexprnoexcept |
Min and max value constructor.
Unlike min_max_count_t. value_type is not guaranteed to be compile-time constructible, and so no compile-time or runtime checking is done on the validity of min and max. Use min_max_count_ct when the input types can be represented in a std::integral_constant
for extra compile-time checks.
min | Minimum value, or empty optional if no minimum bound |
max | Maximum value, or empty optional if no maximum bound |
compare | Comparator instance |
Definition at line 40 of file min_max_value.hpp.
|
inlineconstexprnoexcept |
|
inline |
Checks that value is between the minimum and maximum values.
InputValueType | Parsed value type, must be implicitly constructible from value_type |
Parents | Pack of parent tree nodes in ascending ancestry order |
value | Parsed input value to check |
parents | Parents instances pack |
Definition at line 63 of file min_max_value.hpp.