arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::policy::default_value< T > Class Template Reference

#include <arg_router/policy/default_value.hpp>

Public Types

using value_type = T
 

Public Member Functions

constexpr default_value (value_type value) noexcept
 
template<typename ValueType , typename... Parents>
constexpr ValueType missing_phase ([[maybe_unused]] const Parents &... parents) const noexcept
 

Static Public Attributes

constexpr static auto priority = std::size_t{500}
 

Detailed Description

template<typename T>
class arg_router::policy::default_value< T >

Provides a default value for non-required arguments.

Template Parameters
TValue type

Definition at line 17 of file default_value.hpp.

Member Typedef Documentation

◆ value_type

template<typename T >
using arg_router::policy::default_value< T >::value_type = T

Alias of T.

Definition at line 21 of file default_value.hpp.

Constructor & Destructor Documentation

◆ default_value()

template<typename T >
constexpr arg_router::policy::default_value< T >::default_value ( value_type  value)
inlineexplicitconstexprnoexcept

Constructor

Parameters
valueDefault value

Definition at line 30 of file default_value.hpp.

Member Function Documentation

◆ missing_phase()

template<typename T >
template<typename ValueType , typename... Parents>
constexpr ValueType arg_router::policy::default_value< T >::missing_phase ( [[maybe_unused] ] const Parents &...  parents) const
inlineconstexprnoexcept

Called when the owning node's token (if any) is missing from the command line, this will return the default value.

Template Parameters
ValueTypeParsed value type, must be implicitly constructible from value_type
ParentsPack of parent tree nodes in ascending ancestry order
Parameters
parentsParents instances pack
Returns
Default value

Definition at line 41 of file default_value.hpp.

Member Data Documentation

◆ priority

template<typename T >
constexpr static auto arg_router::policy::default_value< T >::priority = std::size_t{500}
staticconstexpr

Policy priority.

Definition at line 24 of file default_value.hpp.


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