spdlog/spdlog-1.14.1-fmt-11.0.2.patch

25 lines
953 B
Diff

From 06f92eae2bb37658561e0c87516c29e8e094f0a8 Mon Sep 17 00:00:00 2001
From: Yao Zi <ziyao@disroot.org>
Date: Mon, 8 Jul 2024 19:37:05 +0000
Subject: [PATCH] make example compatible with fmt 11
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 d4cfa1e29..267e42151 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<my_type> : fmt::formatter<std::string> {
- 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);
}
};