Skip to content

Commit

Permalink
Fix error C2668 on Windows with option /std:c++latest (fmtlib#3680)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Zhaojun-Liu committed Oct 16, 2023
1 parent d9063ba commit 2ac6c5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/format-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ FMT_BEGIN_NAMESPACE
template <> struct formatter<point> : nested_formatter<double> {
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));
});
}
};
Expand Down

0 comments on commit 2ac6c5c

Please sign in to comment.