21namespace sharg::custom
59struct parsing<t &> : parsing<t>
63struct parsing<t const &> : parsing<t>
69namespace sharg::detail
88namespace sharg::detail::adl_only
98template <
typename option_t>
99struct enumeration_names_cpo
104 constexpr enumeration_names_cpo() =
default;
105 constexpr enumeration_names_cpo(enumeration_names_cpo &&) =
default;
106 constexpr enumeration_names_cpo(enumeration_names_cpo
const &) =
default;
107 constexpr enumeration_names_cpo & operator=(enumeration_names_cpo &&) =
default;
108 constexpr enumeration_names_cpo & operator=(enumeration_names_cpo
const &) =
default;
114 template <
typename option_type>
115 using option_or_type_identity =
123 template <
typename option_type = option_t>
124 static constexpr auto cpo_overload(sharg::detail::priority_tag<1>)
noexcept(
140 template <
typename option_type = option_t>
141 static constexpr auto cpo_overload(sharg::detail::priority_tag<0>)
noexcept(
142 noexcept(enumeration_names(option_or_type_identity<option_type>{})))
143 ->
decltype(enumeration_names(option_or_type_identity<option_type>{}))
145 return enumeration_names(option_or_type_identity<option_type>{});
159 template <
typename... args_t,
typename option_type = option_t >
160 constexpr auto operator()(args_t &&... args)
const
161 noexcept(
noexcept(cpo_overload(sharg::detail::priority_tag<1>{}, std::forward<args_t>(args)...)))
162 ->
decltype(cpo_overload(sharg::detail::priority_tag<1>{}, std::forward<args_t>(args)...))
164 return cpo_overload(sharg::detail::priority_tag<1>{}, std::forward<args_t>(args)...);
217template <
typename option_type>
218 requires requires { { detail::adl_only::enumeration_names_cpo<option_type>{}() }; }
219inline auto const enumeration_names SHARG_DOXYGEN_ONLY((
size_t value)) = detail::adl_only::enumeration_names_cpo<option_type>{}();
239template <
typename option_type>
242 { sharg::enumeration_names<option_type> };
255template <
typename option_type>
257inline ostream & operator<<(ostream & s, option_type && op)
259 for (
auto & [key, value] : sharg::enumeration_names<option_type>)
265 return s <<
"<UNKNOWN_VALUE>";
Checks whether the free function sharg::enumeration_names can be called on the type.
Definition: enumeration_names.hpp:240
auto const enumeration_names(size_t value)
Return a conversion map from std::string_view to option_type.
A type that can be specialised to provide customisation point implementations for the sharg::parser s...
Definition: enumeration_names.hpp:51