Skip to content

Commit e2797c4

Browse files
committed
wip
1 parent e77ff3b commit e2797c4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: include/magic_enum/magic_enum_format.hpp

+12
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,16 @@ struct std::formatter<E, std::enable_if_t<std::is_enum_v<std::decay_t<E>>, char>
6969

7070
#endif
7171

72+
#if defined(FMT_VERSION)
73+
74+
template <typename E>
75+
struct fmt::formatter<E, std::enable_if_t<std::is_enum_v<std::decay_t<E>>, char>> : fmt::formatter<std::string_view, char> {
76+
template <class FormatContext>
77+
auto format(E e, FormatContext& ctx) const {
78+
return formatter<std::string_view, char>::format(format_as<E>(e), ctx);
79+
}
80+
};
81+
82+
#endif
83+
7284
#endif // NEARGYE_MAGIC_ENUM_FORMAT_HPP

0 commit comments

Comments
 (0)