|
cli20 0.1.2
A C++20 typed-schema command-line parser
|
Converts a string token to type T via a user-supplied mapper function. More...
#include <action.hh>
Public Types | |
| template<class Input> | |
| using | after_type = T |
| template<class Prev> | |
| using | storage_type = void |
Public Member Functions | |
| auto | operator() (ActionCtx< void > ctx, ActionResult< std::string_view > input) const -> ActionResult< T > |
Static Public Attributes | |
| template<class Input> | |
| static constexpr bool | accepts_input = Bool::template accepts_input<Input> |
Converts a string token to type T via a user-supplied mapper function.
Mapper must be a constexpr callable of the form (std::string_view) -> std::optional<T>. Returns ErrorCode::invalid_choice when the mapper returns std::nullopt.
| T | The target value type. |
| Mapper | A constexpr callable mapping strings to std::optional<T>. |
| using cli::conversion::Choice< T, Mapper >::after_type = T |
| using cli::conversion::Choice< T, Mapper >::storage_type = void |
|
inline |
|
staticconstexpr |