Sharg 1.1.2-rc.1
The argument parser for bio-c++ tools.
Loading...
Searching...
No Matches
sharg::detail::adl_only::enumeration_names_cpo< option_t > Struct Template Reference

Customization Point Object (CPO) definition for sharg::enumeration_names. More...

#include <sharg/enumeration_names.hpp>

Public Types

template<typename option_type >
using option_or_type_identity
 If option_t is not std::is_nothrow_default_constructible, enumeration_names will be called with std::type_identity instead of a default constructed alphabet.
 

Public Member Functions

template<typename... args_t, typename option_type = option_t>
constexpr auto operator() (args_t &&... args) const noexcept(noexcept(cpo_overload(sharg::detail::priority_tag< 1 >{}, std::forward< args_t >(args)...))) -> decltype(cpo_overload(sharg::detail::priority_tag< 1 >{}, std::forward< args_t >(args)...))
 SFINAE-friendly call-operator to resolve the CPO overload.
 
Constructors, destructor and assignment
constexpr enumeration_names_cpo ()=default
 Defaulted.
 
constexpr enumeration_names_cpo (enumeration_names_cpo &&)=default
 Defaulted.
 
constexpr enumeration_names_cpo (enumeration_names_cpo const &)=default
 Defaulted.
 
constexpr enumeration_names_cpooperator= (enumeration_names_cpo &&)=default
 Defaulted.
 
constexpr enumeration_names_cpooperator= (enumeration_names_cpo const &)=default
 

Static Public Member Functions

template<typename option_type = option_t>
static constexpr auto cpo_overload (sharg::detail::priority_tag< 1 >) noexcept(noexcept(sharg::custom::parsing< option_type >::enumeration_names)) -> decltype(sharg::custom::parsing< option_type >::enumeration_names)
 CPO overload (check 1 out of 2): explicit customisation via sharg::custom::parsing
 
template<typename option_type = option_t>
static constexpr auto cpo_overload (sharg::detail::priority_tag< 0 >) noexcept(noexcept(enumeration_names(option_or_type_identity< option_type >{}))) -> decltype(enumeration_names(option_or_type_identity< option_type >{}))
 CPO overload (check 2 out of 2): argument dependent lookup (ADL), i.e. enumeration_names(option_type{})
 

Detailed Description

template<typename option_t>
struct sharg::detail::adl_only::enumeration_names_cpo< option_t >

Customization Point Object (CPO) definition for sharg::enumeration_names.

Remarks
For a complete overview, take a look at Parser

Member Typedef Documentation

◆ option_or_type_identity

template<typename option_t >
template<typename option_type >
using sharg::detail::adl_only::enumeration_names_cpo< option_t >::option_or_type_identity

Member Function Documentation

◆ cpo_overload() [1/2]

template<typename option_t >
template<typename option_type = option_t>
static constexpr auto sharg::detail::adl_only::enumeration_names_cpo< option_t >::cpo_overload ( sharg::detail::priority_tag< 0 > ) -> decltype(enumeration_names(option_or_type_identity<option_type>{}))
inlinestaticconstexprnoexcept

CPO overload (check 2 out of 2): argument dependent lookup (ADL), i.e. enumeration_names(option_type{})

Template Parameters
option_typeThe type of the option. (Needed to defer instantiation for incomplete types.)

If the option_type is not std::is_nothrow_default_constructible, enumeration_names(std::type_identity<option_t>{}) will be called.

◆ cpo_overload() [2/2]

template<typename option_t >
template<typename option_type = option_t>
static constexpr auto sharg::detail::adl_only::enumeration_names_cpo< option_t >::cpo_overload ( sharg::detail::priority_tag< 1 > ) -> decltype(sharg::custom::parsing<option_type>::enumeration_names)
inlinestaticconstexprnoexcept

CPO overload (check 1 out of 2): explicit customisation via sharg::custom::parsing

Template Parameters
option_typeThe type of the option. (Needed to defer instantiation for incomplete types.)

◆ operator()()

template<typename option_t >
template<typename... args_t, typename option_type = option_t>
constexpr auto sharg::detail::adl_only::enumeration_names_cpo< option_t >::operator() ( args_t &&... args) const -> decltype(cpo_overload(sharg::detail::priority_tag<1>{}, std::forward<args_t>(args)...))
inlineconstexprnoexcept

SFINAE-friendly call-operator to resolve the CPO overload.

This operator decides which cpo_overload implementation to use. It will start with the highest priority, in this case sharg::detail::priority_tag<1>. If this is not well-defined, the base class of the priority_tag is checked (sharg::detail::priority_tag<0>). If there are multiple cpo_overload overloads, the priority_tag decides the order of resolution, the highest number is tried first.

If any matching overload is found, this operator perfectly forwards the result and noexcept-property of the cpo_overload.

◆ operator=()

template<typename option_t >
constexpr enumeration_names_cpo & sharg::detail::adl_only::enumeration_names_cpo< option_t >::operator= ( enumeration_names_cpo< option_t > const & )
constexprdefault

Defaulted.


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