arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::policy::min_max_value_ct< MinType, MaxType > Class Template Reference

#include <arg_router/policy/min_max_value.hpp>

Public Member Functions

 min_max_value_ct () noexcept
 
template<typename InputValueType , typename... Parents>
void validation_phase (const InputValueType &value, [[maybe_unused]] const Parents &... parents) const
 

Static Public Member Functions

template<typename T = MinType>
constexpr static auto minimum_value (std::enable_if_t<!std::is_void_v< T >> *=nullptr) noexcept
 
template<typename T = MaxType>
constexpr static auto maximum_value (std::enable_if_t<!std::is_void_v< T >> *=nullptr) noexcept
 

Detailed Description

template<typename MinType, typename MaxType>
class arg_router::policy::min_max_value_ct< MinType, MaxType >

Compile-time equivalent to min_max_value_t.

Use the min_max_value() function to create for ease. operator< is used for comparisons.

Using this policy also improves help output.

Template Parameters
MinTypeCompile-time integral constant value representing the minimum, or void if no minimum bound
MaxTypeCompile-time integral constant value representing the maximum, or void if no minimum bound

Definition at line 98 of file min_max_value.hpp.

Constructor & Destructor Documentation

◆ min_max_value_ct()

template<typename MinType , typename MaxType >
arg_router::policy::min_max_value_ct< MinType, MaxType >::min_max_value_ct ( )
inlineexplicitnoexcept

Constructor.

Definition at line 105 of file min_max_value.hpp.

Member Function Documentation

◆ maximum_value()

template<typename MinType , typename MaxType >
template<typename T = MaxType>
constexpr static auto arg_router::policy::min_max_value_ct< MinType, MaxType >::maximum_value ( std::enable_if_t<!std::is_void_v< T >> *  = nullptr)
inlinestaticconstexprnoexcept

Returns the maximum value.

This method is only available if there is a maximum value.

Returns
Maximum value

Definition at line 148 of file min_max_value.hpp.

◆ minimum_value()

template<typename MinType , typename MaxType >
template<typename T = MinType>
constexpr static auto arg_router::policy::min_max_value_ct< MinType, MaxType >::minimum_value ( std::enable_if_t<!std::is_void_v< T >> *  = nullptr)
inlinestaticconstexprnoexcept

Returns the minimum value.

This method is only available if there is a minimum value.

Returns
Minimum value

Definition at line 135 of file min_max_value.hpp.

◆ validation_phase()

template<typename MinType , typename MaxType >
template<typename InputValueType , typename... Parents>
void arg_router::policy::min_max_value_ct< MinType, MaxType >::validation_phase ( const InputValueType &  value,
[[maybe_unused] ] const Parents &...  parents 
) const
inline

Checks that value is between the minimum and maximum values.

Template Parameters
InputValueTypeParsed value type, must be implicitly constructible from value_type
ParentsPack of parent tree nodes in ascending ancestry order
Parameters
valueParsed input value to check
parentsParents instances pack
Exceptions
multi_lang_exceptionThrown if the value is out of bounds

Definition at line 164 of file min_max_value.hpp.


The documentation for this class was generated from the following file: