18namespace sharg::custom
56struct parsing<t &> : parsing<t>
60struct parsing<t const &> : parsing<t>
66namespace sharg::detail
85namespace sharg::detail::adl_only
95template <
typename option_t>
111 template <
typename option_type>
120 template <
typename option_type = option_t>
137 template <
typename option_type = option_t>
141 return enumeration_names(option_or_type_identity<option_type>{});
155 template <
typename... args_t,
typename option_type = option_t >
211template <
typename option_type>
212 requires requires { { detail::adl_only::enumeration_names_cpo<option_type>{}() }; }
233template <
typename option_type>
236 { sharg::enumeration_names<option_type> };
249template <
typename option_type>
251inline ostream & operator<<(ostream & s, option_type &&
op)
253 for (
auto & [
key, value] : sharg::enumeration_names<option_type>)
259 return s <<
"<UNKNOWN_VALUE>";
Checks whether the free function sharg::enumeration_names can be called on the type.
Definition enumeration_names.hpp:234
std::unordered_map< std::string_view, t > enumeration_names(t)=delete
Poison-pill overload to prevent non-ADL forms of unqualified lookup.
auto const enumeration_names
Return a conversion map from std::string_view to option_type.
Definition enumeration_names.hpp:213
A type that can be specialised to provide customisation point implementations for the sharg::parser s...
Definition enumeration_names.hpp:48
Customization Point Object (CPO) definition for sharg::enumeration_names.
Definition enumeration_names.hpp:97
constexpr enumeration_names_cpo & operator=(enumeration_names_cpo &&)=default
Defaulted.
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{...
Definition enumeration_names.hpp:138
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.
Definition enumeration_names.hpp:156
constexpr enumeration_names_cpo & operator=(enumeration_names_cpo const &)=default
constexpr enumeration_names_cpo()=default
Defaulted.
constexpr enumeration_names_cpo(enumeration_names_cpo const &)=default
Defaulted.
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
Definition enumeration_names.hpp:121
constexpr enumeration_names_cpo(enumeration_names_cpo &&)=default
Defaulted.
A tag that allows controlled overload resolution via implicit base conversion rules.
Definition enumeration_names.hpp:76