From d276069a6e916b1e1fd45885b15b72bd8ee000a7 Mon Sep 17 00:00:00 2001 From: Ziyao Date: Tue, 9 Jul 2024 04:14:30 +0800 Subject: [PATCH] make example compatible with fmt 11 (#3130) Since fmt 11.0.0, formatter::format() is required to be const. Mark format() method in example as const to stay compatible with fmt 11. --- example/example.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } };