diff --git a/include/fmt/format.h b/include/fmt/format.h index 0e2a8da1..d0908038 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1760,6 +1760,13 @@ OutputIt write(OutputIt out, basic_string_view value) { return base_iterator(out, it); } +template +buffer_appender write(buffer_appender out, + basic_string_view value) { + get_container(out).append(value.begin(), value.end()); + return out; +} + template ::value && !std::is_same::value && diff --git a/test/os-test.cc b/test/os-test.cc index faf0a0d8..2d11c4c9 100644 --- a/test/os-test.cc +++ b/test/os-test.cc @@ -81,9 +81,9 @@ TEST(UtilTest, FormatWindowsError) { EXPECT_EQ(fmt::format("test: {}", utf8_message.str()), fmt::to_string(actual_message)); actual_message.resize(0); - auto max_size = fmt::detail::max_value(); + auto max_size = fmt::detail::max_value(); fmt::detail::format_windows_error(actual_message, ERROR_FILE_EXISTS, - fmt::string_view(0, max_size)); + fmt::string_view(nullptr, max_size)); EXPECT_EQ(fmt::format("error {}", ERROR_FILE_EXISTS), fmt::to_string(actual_message)); }