From c8189d26a2e1d57d1ce227b02796276337fba5ca Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Fri, 20 Sep 2024 16:53:00 +0200 Subject: made fmt formatter format function const (#162) this appears to be required as of fmt v11 --- src/zencore/include/zencore/fmtutils.h | 8 ++++---- src/zenhttp/include/zenhttp/formatters.h | 4 ++-- src/zenstore/include/zenstore/gc.h | 2 +- src/zenutil/include/zenutil/cache/cache.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/zencore/include/zencore/fmtutils.h b/src/zencore/include/zencore/fmtutils.h index 9c5bdae66..8482157fb 100644 --- a/src/zencore/include/zencore/fmtutils.h +++ b/src/zencore/include/zencore/fmtutils.h @@ -40,7 +40,7 @@ template<> struct fmt::formatter : formatter { template - auto format(const zen::IoHash& Hash, FormatContext& ctx) + auto format(const zen::IoHash& Hash, FormatContext& ctx) const { zen::IoHash::String_t String; Hash.ToHexString(String); @@ -52,7 +52,7 @@ template<> struct fmt::formatter : formatter { template - auto format(const zen::Oid& Id, FormatContext& ctx) + auto format(const zen::Oid& Id, FormatContext& ctx) const { zen::StringBuilder<32> String; Id.ToString(String); @@ -64,7 +64,7 @@ template<> struct fmt::formatter : formatter { template - auto format(const zen::Guid& Id, FormatContext& ctx) + auto format(const zen::Guid& Id, FormatContext& ctx) const { zen::StringBuilder<48> String; Id.ToString(String); @@ -76,7 +76,7 @@ template<> struct fmt::formatter : formatter { template - auto format(const std::filesystem::path& Path, FormatContext& ctx) + auto format(const std::filesystem::path& Path, FormatContext& ctx) const { using namespace std::literals; diff --git a/src/zenhttp/include/zenhttp/formatters.h b/src/zenhttp/include/zenhttp/formatters.h index d45f5fbb2..538136238 100644 --- a/src/zenhttp/include/zenhttp/formatters.h +++ b/src/zenhttp/include/zenhttp/formatters.h @@ -19,7 +19,7 @@ struct fmt::formatter constexpr auto parse(format_parse_context& Ctx) -> decltype(Ctx.begin()) { return Ctx.end(); } template - auto format(const cpr::Response& Response, FormatContext& Ctx) -> decltype(Ctx.out()) + auto format(const cpr::Response& Response, FormatContext& Ctx) const -> decltype(Ctx.out()) { using namespace std::literals; @@ -77,7 +77,7 @@ struct fmt::formatter constexpr auto parse(format_parse_context& Ctx) -> decltype(Ctx.begin()) { return Ctx.end(); } template - auto format(const zen::HttpClient::Response& Response, FormatContext& Ctx) -> decltype(Ctx.out()) + auto format(const zen::HttpClient::Response& Response, FormatContext& Ctx) const -> decltype(Ctx.out()) { using namespace std::literals; diff --git a/src/zenstore/include/zenstore/gc.h b/src/zenstore/include/zenstore/gc.h index 111b9886e..a8c5c0219 100644 --- a/src/zenstore/include/zenstore/gc.h +++ b/src/zenstore/include/zenstore/gc.h @@ -591,7 +591,7 @@ template<> struct fmt::formatter : formatter { template - auto format(const zen::GcClock::TimePoint& TimePoint, FormatContext& ctx) + auto format(const zen::GcClock::TimePoint& TimePoint, FormatContext& ctx) const { std::time_t Time = std::chrono::system_clock::to_time_t(TimePoint); char TimeString[std::size("yyyy-mm-ddThh:mm:ss")]; diff --git a/src/zenutil/include/zenutil/cache/cache.h b/src/zenutil/include/zenutil/cache/cache.h index 5e12c488c..20299a667 100644 --- a/src/zenutil/include/zenutil/cache/cache.h +++ b/src/zenutil/include/zenutil/cache/cache.h @@ -23,7 +23,7 @@ template<> struct fmt::formatter : formatter { template - auto format(const zen::CacheRequestContext& Context, FormatContext& ctx) + auto format(const zen::CacheRequestContext& Context, FormatContext& ctx) const { zen::ExtendableStringBuilder<64> String; Context.SessionId.ToString(String); -- cgit v1.2.3