From e8be3c3e0e8b526c9aae84fd835ddb633dd32dcb Mon Sep 17 00:00:00 2001 From: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:39:43 -0400 Subject: [PATCH] core: Mark spdlog specialization functions as const (fixes #524). (#525) --- components/core/src/clp/spdlog_with_specializations.hpp | 8 +++++--- components/core/src/glt/spdlog_with_specializations.hpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/components/core/src/clp/spdlog_with_specializations.hpp b/components/core/src/clp/spdlog_with_specializations.hpp index 24771f44e..e80993592 100644 --- a/components/core/src/clp/spdlog_with_specializations.hpp +++ b/components/core/src/clp/spdlog_with_specializations.hpp @@ -16,7 +16,7 @@ struct fmt::formatter { } template - auto format(clp::ErrorCode const& error_code, FormatContext& ctx) { + auto format(clp::ErrorCode const& error_code, FormatContext& ctx) const { return fmt::format_to(ctx.out(), "{}", static_cast(error_code)); } }; @@ -30,7 +30,8 @@ struct fmt::formatter> template auto - format(clp::ffi::search::ExactVariableToken const& v, FormatContext& ctx) { + format(clp::ffi::search::ExactVariableToken const& v, + FormatContext& ctx) const { return fmt::format_to( ctx.out(), "ExactVariableToken(\"{}\") as {}", @@ -48,7 +49,8 @@ struct fmt::formatter> { } template - auto format(clp::ffi::search::WildcardToken const& v, FormatContext& ctx) { + auto + format(clp::ffi::search::WildcardToken const& v, FormatContext& ctx) const { return fmt::format_to( ctx.out(), "WildcardToken(\"{}\") as {}TokenType({}){}", diff --git a/components/core/src/glt/spdlog_with_specializations.hpp b/components/core/src/glt/spdlog_with_specializations.hpp index 8cd279e9e..1518d5a62 100644 --- a/components/core/src/glt/spdlog_with_specializations.hpp +++ b/components/core/src/glt/spdlog_with_specializations.hpp @@ -16,7 +16,7 @@ struct fmt::formatter { } template - auto format(glt::ErrorCode const& error_code, FormatContext& ctx) { + auto format(glt::ErrorCode const& error_code, FormatContext& ctx) const { return fmt::format_to(ctx.out(), "{}", static_cast(error_code)); } }; @@ -30,7 +30,8 @@ struct fmt::formatter> template auto - format(glt::ffi::search::ExactVariableToken const& v, FormatContext& ctx) { + format(glt::ffi::search::ExactVariableToken const& v, + FormatContext& ctx) const { return fmt::format_to( ctx.out(), "ExactVariableToken(\"{}\") as {}", @@ -48,7 +49,8 @@ struct fmt::formatter> { } template - auto format(glt::ffi::search::WildcardToken const& v, FormatContext& ctx) { + auto + format(glt::ffi::search::WildcardToken const& v, FormatContext& ctx) const { return fmt::format_to( ctx.out(), "WildcardToken(\"{}\") as {}TokenType({}){}",