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

Converts a string token to NegatableResult by detecting a compile-time negation prefix. More...

#include <action.hh>

Public Types

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

Public Member Functions

constexpr auto operator() (ActionCtx< void >, ActionResult< std::string_view > input) const -> ActionResult< NegatableResult >

Static Public Attributes

template<class Input>
static constexpr bool accepts_input

Detailed Description

template<StringLiteral Prefix>
struct cli::conversion::Negatable< Prefix >

Converts a string token to NegatableResult by detecting a compile-time negation prefix.

Given prefix "no-":

  • "lto" → {"lto", true}
  • "no-lto" → {"lto", false}
Template Parameters
PrefixThe negation prefix string (e.g. "no-", "!").

Definition at line 950 of file action.hh.

Member Typedef Documentation

◆ after_type

template<StringLiteral Prefix>
template<class Input>
using cli::conversion::Negatable< Prefix >::after_type = NegatableResult

Definition at line 957 of file action.hh.

◆ storage_type

template<StringLiteral Prefix>
template<class Prev>
using cli::conversion::Negatable< Prefix >::storage_type = void

Definition at line 960 of file action.hh.

Member Function Documentation

◆ operator()()

template<StringLiteral Prefix>
auto cli::conversion::Negatable< Prefix >::operator() ( ActionCtx< void > ,
ActionResult< std::string_view > input ) const -> ActionResult< NegatableResult >
inlineconstexpr

Definition at line 962 of file action.hh.

Member Data Documentation

◆ accepts_input

template<StringLiteral Prefix>
template<class Input>
bool cli::conversion::Negatable< Prefix >::accepts_input
staticconstexpr
Initial value:
=
std::same_as<std::remove_cvref_t<Input>, std::string_view> ||
std::same_as<std::remove_cvref_t<Input>, std::string>

Definition at line 952 of file action.hh.


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