diff --git a/include/fmt/format.h b/include/fmt/format.h index 5095a7a0..9f522f39 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3457,16 +3457,17 @@ inline wformat_context::iterator vformat_to( return vformat_to>(buf, format_str, args); } -template -inline format_context::iterator format_to( - basic_memory_buffer &buf, const String &format_str, +template < + typename String, typename... Args, + std::size_t SIZE = inline_buffer_size, + typename Char = typename internal::format_string_traits::char_type> +inline typename buffer_context::type::iterator format_to( + basic_memory_buffer &buf, const String &format_str, const Args & ... args) { internal::check_format_string(format_str); - typedef typename internal::format_string_traits::char_type char_t; return vformat_to( - buf, basic_string_view(format_str), - make_format_args::type>(args...)); + buf, basic_string_view(format_str), + make_format_args::type>(args...)); } template diff --git a/test/format-test.cc b/test/format-test.cc index b9d73ed4..31a76c3a 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -692,6 +692,9 @@ TEST(FormatToTest, FormatToMemoryBuffer) { fmt::basic_memory_buffer buffer; fmt::format_to(buffer, "{}", "foo"); EXPECT_EQ("foo", to_string(buffer)); + fmt::wmemory_buffer wbuffer; + fmt::format_to(wbuffer, L"{}", L"foo"); + EXPECT_EQ(L"foo", to_string(wbuffer)); } TEST(FormatterTest, Escape) {