From 51ec4520132b2c64f7dc674e7634a0d6b5b25845 Mon Sep 17 00:00:00 2001 From: LiAuTraver Date: Mon, 18 Nov 2024 15:04:09 +0800 Subject: [PATCH] add explicit mt:: and std:: to avoid ambiguous call when both std::format_to and mt::format_to are present --- README.md | 2 +- example/example.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c45d7a0a..1aab857b 100644 --- a/README.md +++ b/README.md @@ -303,7 +303,7 @@ struct fmt::formatter : fmt::formatter { auto format(my_type my, format_context &ctx) const -> decltype(ctx.out()) { - return format_to(ctx.out(), "[my_type i={}]", my.i); + return fmt::format_to(ctx.out(), "[my_type i={}]", my.i); } }; diff --git a/example/example.cpp b/example/example.cpp index a2daf372..26b92a15 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -281,7 +281,7 @@ struct fmt::formatter : fmt::formatter { template <> struct std::formatter : std::formatter { auto format(my_type my, format_context &ctx) const -> decltype(ctx.out()) { - return format_to(ctx.out(), "[my_type i={}]", my.i); + return std::format_to(ctx.out(), "[my_type i={}]", my.i); } }; #endif