Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Neargye committed Nov 13, 2024
1 parent e77ff3b commit e2797c4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/magic_enum/magic_enum_format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,16 @@ struct std::formatter<E, std::enable_if_t<std::is_enum_v<std::decay_t<E>>, char>

#endif

#if defined(FMT_VERSION)

template <typename E>
struct fmt::formatter<E, std::enable_if_t<std::is_enum_v<std::decay_t<E>>, char>> : fmt::formatter<std::string_view, char> {
template <class FormatContext>
auto format(E e, FormatContext& ctx) const {
return formatter<std::string_view, char>::format(format_as<E>(e), ctx);
}
};

#endif

#endif // NEARGYE_MAGIC_ENUM_FORMAT_HPP

0 comments on commit e2797c4

Please sign in to comment.