forked from fmtlib/fmt
Finish text::format
This commit is contained in:
@ -378,8 +378,7 @@ template <typename Char> struct text {
|
|||||||
|
|
||||||
template <typename OutputIt, typename... Args>
|
template <typename OutputIt, typename... Args>
|
||||||
OutputIt format(OutputIt out, const Args&...) const {
|
OutputIt format(OutputIt out, const Args&...) const {
|
||||||
// TODO: reserve
|
return write<Char>(out, data);
|
||||||
return copy_str<Char>(data.begin(), data.end(), out);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -155,4 +155,8 @@ TEST(CompileTest, FormatDefault) {
|
|||||||
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), "foo"));
|
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), "foo"));
|
||||||
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), std::string("foo")));
|
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), std::string("foo")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(CompileTest, TextAndArg) {
|
||||||
|
EXPECT_EQ(">>>42<<<", fmt::format(FMT_COMPILE(">>>{}<<<"), 42));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user