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

Invokes a compile-time callable Fn with the parsed value as a terminal action. More...

#include <action.hh>

Public Types

template<class Prev>
using after_type = void
template<class Prev>
using storage_type = std::monostate

Public Member Functions

template<class T>
auto operator() (ActionCtx< std::monostate > ctx, ActionResult< T > input) const -> ActionResult< void >

Static Public Attributes

template<class Prev>
static constexpr bool accepts_input = CallbackInvocable<Fn, Prev>

Detailed Description

template<auto Fn>
struct cli::pack::Callback< Fn >

Invokes a compile-time callable Fn with the parsed value as a terminal action.

Fn may have any of the following signatures:

  • (ActionCtx<std::monostate>, T&) — receives context and value.
  • (T&) — receives value only.
  • () — receives nothing.

Storage type: std::monostate (no value is stored; the callback is the only effect).

Template Parameters
FnA constexpr callable to invoke.

Definition at line 1847 of file action.hh.

Member Typedef Documentation

◆ after_type

template<auto Fn>
template<class Prev>
using cli::pack::Callback< Fn >::after_type = void

Definition at line 1852 of file action.hh.

◆ storage_type

template<auto Fn>
template<class Prev>
using cli::pack::Callback< Fn >::storage_type = std::monostate

Definition at line 1855 of file action.hh.

Member Function Documentation

◆ operator()()

template<auto Fn>
template<class T>
auto cli::pack::Callback< Fn >::operator() ( ActionCtx< std::monostate > ctx,
ActionResult< T > input ) const -> ActionResult< void >
inline

Definition at line 1859 of file action.hh.

Member Data Documentation

◆ accepts_input

template<auto Fn>
template<class Prev>
bool cli::pack::Callback< Fn >::accepts_input = CallbackInvocable<Fn, Prev>
staticconstexpr

Definition at line 1849 of file action.hh.


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