From 6c3b2d491e23a3fb8eb2bc998acfecb53b19171f Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 1 Jan 2024 19:50:36 -0800 Subject: [PATCH] Fix constness --- test/args-test.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/args-test.cc b/test/args-test.cc index 3ab313359860..9c72cb953a6d 100644 --- a/test/args-test.cc +++ b/test/args-test.cc @@ -38,12 +38,13 @@ struct custom_type { FMT_BEGIN_NAMESPACE template <> struct formatter { - auto parse(format_parse_context& ctx) const -> decltype(ctx.begin()) { + auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); } template - auto format(const custom_type& p, FormatContext& ctx) -> decltype(ctx.out()) { + auto format(const custom_type& p, FormatContext& ctx) const + -> decltype(ctx.out()) { return fmt::format_to(ctx.out(), "cust={}", p.i); } }; @@ -68,11 +69,11 @@ struct to_stringable { FMT_BEGIN_NAMESPACE template <> struct formatter { - auto parse(format_parse_context& ctx) const -> decltype(ctx.begin()) { + auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); } - auto format(to_stringable, format_context& ctx) -> decltype(ctx.out()) { + auto format(to_stringable, format_context& ctx) const -> decltype(ctx.out()) { return ctx.out(); } }; @@ -155,10 +156,11 @@ struct copy_throwable { FMT_BEGIN_NAMESPACE template <> struct formatter { - auto parse(format_parse_context& ctx) const -> decltype(ctx.begin()) { + auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) { return ctx.begin(); } - auto format(copy_throwable, format_context& ctx) -> decltype(ctx.out()) { + auto format(copy_throwable, format_context& ctx) const + -> decltype(ctx.out()) { return ctx.out(); } };