Fix format_to + FMT_STRING for wide character type (#3931)

Added overload that takes a wformat_string.
Fixes issue #3925.
This commit is contained in:
Hans-Martin B. Jensen
2024-04-17 17:30:48 +02:00
committed by GitHub
parent 99735764ea
commit ee0c3351a4
2 changed files with 16 additions and 2 deletions

View File

@ -195,6 +195,12 @@ TEST(xchar_test, format_to) {
EXPECT_STREQ(buf.data(), L"42");
}
TEST(xchar_test, compile_time_string_format_to) {
std::wstring ws;
fmt::format_to(std::back_inserter(ws), FMT_STRING(L"{}"), 42);
EXPECT_EQ(L"42", ws);
}
TEST(xchar_test, vformat_to) {
int n = 42;
auto args = fmt::make_wformat_args(n);