diff --git a/format.h b/format.h index 0122f47e..6d4aa95d 100644 --- a/format.h +++ b/format.h @@ -1435,7 +1435,7 @@ class BasicWriter { return *this; } - void write(const std::basic_string &s, const FormatSpec &spec) { + void write_str(const std::basic_string &s, const FormatSpec &spec) { write_str(s.data(), s.size(), spec); } @@ -1645,7 +1645,7 @@ template void format(BasicWriter &w, const FormatSpec &spec, const T &value) { std::basic_ostringstream os; os << value; - w.write(os.str(), spec); + w.write_str(os.str(), spec); } namespace internal { diff --git a/test/format-test.cc b/test/format-test.cc index 49072cf2..f8acaa81 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1319,7 +1319,7 @@ class Answer {}; template void format(BasicWriter &w, const fmt::FormatSpec &spec, Answer) { - w.write("42", spec); + w.write_str("42", spec); } TEST(FormatterTest, CustomFormat) {