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] 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 47916f64..b77ba89a 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)); }); } };