From 3b02292469969135b597864a901003dbdc739d12 Mon Sep 17 00:00:00 2001 From: June Liu <103498042+Zhaojun-Liu@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:06:29 +0800 Subject: [PATCH 1/2] Namespace-qualify to avoid ambiguity with std::format_to for format-test.cc When build fmt with MSVC under option /std:c++latest, it failed due to `error 2668: 'std::format_to': ambiguous call to overloaded function`, so add namespace to qualify the call to format_to to avoid this issue. --- test/format-test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/format-test.cc b/test/format-test.cc index 47916f64de88..b77ba89a0344 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1788,7 +1788,8 @@ FMT_BEGIN_NAMESPACE template <> struct formatter : nested_formatter { auto format(point p, format_context& ctx) const -> decltype(ctx.out()) { return write_padded(ctx, [this, p](auto out) -> decltype(out) { - return format_to(out, "({}, {})", nested(p.x), nested(p.y)); + // Namespace-qualify to avoid ambiguity with std::format_to + return fmt::format_to(out, "({}, {})", nested(p.x), nested(p.y)); }); } }; From f1920b8148aefbacc531d4a1b7ad1cf3a61bdc20 Mon Sep 17 00:00:00 2001 From: June Liu <103498042+Zhaojun-Liu@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:40:20 +0800 Subject: [PATCH 2/2] Update format-test.cc Remove unnecessary comments. --- test/format-test.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/test/format-test.cc b/test/format-test.cc index b77ba89a0344..9788c246d34b 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1788,7 +1788,6 @@ FMT_BEGIN_NAMESPACE template <> struct formatter : nested_formatter { auto format(point p, format_context& ctx) const -> decltype(ctx.out()) { return write_padded(ctx, [this, p](auto out) -> decltype(out) { - // Namespace-qualify to avoid ambiguity with std::format_to return fmt::format_to(out, "({}, {})", nested(p.x), nested(p.y)); }); }