diff --git a/include/magic_enum_format.hpp b/include/magic_enum_format.hpp index bd725b5ea..03f3e44ea 100644 --- a/include/magic_enum_format.hpp +++ b/include/magic_enum_format.hpp @@ -80,8 +80,8 @@ struct std::formatter> && mag #include template -struct fmt::formatter> && magic_enum::customize::enum_format_enabled(), char>> : fmt::formatter { - auto format(E e, format_context& ctx) { +struct fmt::formatter> && magic_enum::customize::enum_format_enabled(), char>> : fmt::formatter { + auto format(E e, format_context& ctx) const { static_assert(std::is_same_v, "formatter requires string_view::value_type type same as char."); using D = std::decay_t;