cli20 0.1.2
A C++20 typed-schema command-line parser
Loading...
Searching...
No Matches
cli::pack::StoreInto< T > Struct Template Reference

Writes the value directly into an external variable via a T* pointer. More...

#include <action.hh>

Public Types

template<class Prev>
using after_type = void
template<class Prev>
using storage_type = T*

Public Member Functions

auto operator() (ActionCtx< T * > ctx, ActionResult< T > input) const -> ActionResult< void >

Static Public Attributes

template<class Prev>
static constexpr bool accepts_input = std::same_as<detail::decay_t<Prev>, T>

Detailed Description

template<class T>
struct cli::pack::StoreInto< T >

Writes the value directly into an external variable via a T* pointer.

Storage type: T*. The pointer must be non-null at the time of parsing; returns ErrorCode::validation_failed with a descriptive message if the pointer is null. Used as the action for BoundOption.

Template Parameters
TThe type of the external variable.

Definition at line 1800 of file action.hh.

Member Typedef Documentation

◆ after_type

template<class T>
template<class Prev>
using cli::pack::StoreInto< T >::after_type = void

Definition at line 1805 of file action.hh.

◆ storage_type

template<class T>
template<class Prev>
using cli::pack::StoreInto< T >::storage_type = T*

Definition at line 1808 of file action.hh.

Member Function Documentation

◆ operator()()

template<class T>
auto cli::pack::StoreInto< T >::operator() ( ActionCtx< T * > ctx,
ActionResult< T > input ) const -> ActionResult< void >
inline

Definition at line 1810 of file action.hh.

Member Data Documentation

◆ accepts_input

template<class T>
template<class Prev>
bool cli::pack::StoreInto< T >::accepts_input = std::same_as<detail::decay_t<Prev>, T>
staticconstexpr

Definition at line 1802 of file action.hh.


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