diff --git a/example/example.cpp b/example/example.cpp index d4cfa1e2..267e4215 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -272,7 +272,7 @@ struct my_type { #ifndef SPDLOG_USE_STD_FORMAT // when using fmtlib template <> struct fmt::formatter : fmt::formatter { - auto format(my_type my, format_context &ctx) -> decltype(ctx.out()) { + auto format(my_type my, format_context &ctx) const -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "[my_type i={}]", my.i); } };