Skip to content

Commit

Permalink
make example compatible with fmt 11 (#3130)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ziyao233 authored Jul 8, 2024
1 parent eeb22c1 commit d276069
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down

0 comments on commit d276069

Please sign in to comment.