MCPcopy Create free account
hub / github.com/Neargye/magic_enum / common_invocable

Function common_invocable

include/magic_enum/magic_enum_switch.hpp:60–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59template <typename E, enum_subtype S, typename F, std::size_t... I>
60constexpr auto common_invocable(std::index_sequence<I...>) noexcept {
61 static_assert(std::is_enum_v<E>, "magic_enum::detail::invocable_index requires enum type.");
62
63 if constexpr (count_v<E, S> == 0) {
64 return identity<nonesuch>{};
65 } else {
66 return std::common_type<invoke_result_t<F, enum_constant<values_v<E, S>[I]>>...>{};
67 }
68}
69
70template <typename E, enum_subtype S, typename Result, typename F>
71constexpr auto result_type() noexcept {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected