From f76c64abe52481e4b7ea8f086a0eff4cb2da5521 Mon Sep 17 00:00:00 2001 From: Walter Gray Date: Mon, 30 Nov 2020 10:49:15 -0800 Subject: [PATCH] fix wide string formatting --- include/fmt/format.h | 2 +- test/enforce-compiletime-test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index ceef2ef1..ddf24503 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3828,7 +3828,7 @@ inline std::string to_string(T value) { Converts *value* to ``std::wstring`` using the default format for type *T*. */ template inline std::wstring to_wstring(const T& value) { - return format(L"{}", value); + return format(FMT_STRING(L"{}"), value); } template diff --git a/test/enforce-compiletime-test.cc b/test/enforce-compiletime-test.cc index b39745b0..79ab3e82 100644 --- a/test/enforce-compiletime-test.cc +++ b/test/enforce-compiletime-test.cc @@ -145,7 +145,7 @@ TEST(FormatTest, ToString) { EXPECT_EQ("foo", fmt::to_string(adl_test::fmt::detail::foo())); } -//TEST(FormatTest, ToWString) { EXPECT_EQ(L"42", fmt::to_wstring(42)); } +TEST(FormatTest, ToWString) { EXPECT_EQ(L"42", fmt::to_wstring(42)); } TEST(FormatTest, OutputIterators) { std::list out;