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

Validates that the input value equals one of the compile-time constants Allowed. More...

#include <action.hh>

Public Types

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

Public Member Functions

template<class U>
auto operator() (ActionCtx< void > ctx, ActionResult< U > input) const -> ActionResult< U >

Static Public Attributes

template<class Prev>
static constexpr bool accepts_input

Detailed Description

template<auto... Allowed>
struct cli::validation::OneOf< Allowed >

Validates that the input value equals one of the compile-time constants Allowed.

Template Parameters
AllowedNon-type template pack of allowed values. All must be the same type.

Definition at line 1252 of file action.hh.

Member Typedef Documentation

◆ after_type

template<auto... Allowed>
template<class Prev>
using cli::validation::OneOf< Allowed >::after_type = Prev

Definition at line 1260 of file action.hh.

◆ storage_type

template<auto... Allowed>
template<class Prev>
using cli::validation::OneOf< Allowed >::storage_type = void

Definition at line 1263 of file action.hh.

Member Function Documentation

◆ operator()()

template<auto... Allowed>
template<class U>
auto cli::validation::OneOf< Allowed >::operator() ( ActionCtx< void > ctx,
ActionResult< U > input ) const -> ActionResult< U >
inline

Definition at line 1266 of file action.hh.

Member Data Documentation

◆ accepts_input

template<auto... Allowed>
template<class Prev>
bool cli::validation::OneOf< Allowed >::accepts_input
staticconstexpr
Initial value:
=
((std::same_as<detail::decay_t<Prev>,
detail::decay_t<decltype(Allowed)>>) &&
...)

Definition at line 1254 of file action.hh.


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