From 6f44371b5e3134159b37e35c32ffc3bc357596af Mon Sep 17 00:00:00 2001 From: June Liu <103498042+Zhaojun-Liu@users.noreply.github.com> Date: Tue, 17 Oct 2023 00:54:02 +0800 Subject: [PATCH] Fix error C2668 on Windows with option /std:c++latest (#3680) * 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/format-test.cc b/test/format-test.cc index 47916f64de882..9788c246d34b2 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1788,7 +1788,7 @@ 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)); + return fmt::format_to(out, "({}, {})", nested(p.x), nested(p.y)); }); } };