Parameterize format_to on string type (#880)

This commit is contained in:
Victor Zverovich
2018-09-25 07:47:15 -07:00
parent d66fa2216e
commit e4ca37ccf6
2 changed files with 13 additions and 4 deletions
+6
View File
@@ -682,6 +682,12 @@ TEST(FormatToTest, Format) {
EXPECT_EQ("part1part2", s);
}
TEST(FormatToTest, WideString) {
std::vector<wchar_t> buf;
fmt::format_to(std::back_inserter(buf), L"{}{}", 42, L'\0');
EXPECT_STREQ(buf.data(), L"42");
}
TEST(FormatToTest, FormatToNonbackInsertIteratorWithSignAndNumericAlignment) {
char buffer[16] = {};
fmt::format_to(buffer, "{: =+}", 42.0);