mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-06 23:30:29 +00:00
write -> write_str
This commit is contained in:
parent
14e7ed76df
commit
b939860d6e
4
format.h
4
format.h
@ -1435,7 +1435,7 @@ class BasicWriter {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void write(const std::basic_string<Char> &s, const FormatSpec &spec) {
|
void write_str(const std::basic_string<Char> &s, const FormatSpec &spec) {
|
||||||
write_str(s.data(), s.size(), spec);
|
write_str(s.data(), s.size(), spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1645,7 +1645,7 @@ template <typename Char, typename T>
|
|||||||
void format(BasicWriter<Char> &w, const FormatSpec &spec, const T &value) {
|
void format(BasicWriter<Char> &w, const FormatSpec &spec, const T &value) {
|
||||||
std::basic_ostringstream<Char> os;
|
std::basic_ostringstream<Char> os;
|
||||||
os << value;
|
os << value;
|
||||||
w.write(os.str(), spec);
|
w.write_str(os.str(), spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
@ -1319,7 +1319,7 @@ class Answer {};
|
|||||||
|
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
void format(BasicWriter<Char> &w, const fmt::FormatSpec &spec, Answer) {
|
void format(BasicWriter<Char> &w, const fmt::FormatSpec &spec, Answer) {
|
||||||
w.write("42", spec);
|
w.write_str("42", spec);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FormatterTest, CustomFormat) {
|
TEST(FormatterTest, CustomFormat) {
|
||||||
|
Loading…
Reference in New Issue
Block a user