| 121 | |
| 122 | template <typename R, typename E, enum_subtype S, typename F, typename Def> |
| 123 | constexpr decltype(auto) constexpr_switch(F&& f, E value, Def&& def) { |
| 124 | static_assert(is_enum_v<E>, "magic_enum::detail::constexpr_switch requires enum type."); |
| 125 | |
| 126 | if constexpr (count_v<E, S> == 0) { |
| 127 | return def(); |
| 128 | } else { |
| 129 | return constexpr_switch_impl<0, count_v<E, S>, R, E, S>(std::forward<F>(f), value, std::forward<Def>(def)); |
| 130 | } |
| 131 | } |
| 132 | #endif |
| 133 | |
| 134 | } // namespace magic_enum::detail |
nothing calls this directly
no outgoing calls
no test coverage detected