Closed
Description
Using a wide character buffer, fmt::format_to
with FMT_STRING
fails to compile. Compiles fine using narrow character buffer.
// Using a 'char' buffer compiles as expected
std::string buf;
fmt::format_to(std::back_inserter(buf), FMT_STRING("{}"), 1);
// Using 'wchar_t' buffer fails to compile:
// opt/compiler-explorer/libs/fmt/trunk/include/fmt/xchar.h:190:48: error:
// no matching function for call to 'to_string_view(const main()::<lambda()>::FMT_COMPILE_STRING&)'
std::wstring wbuf;
fmt::format_to(std::back_inserter(wbuf), FMT_STRING(L"{}"), 2); // this compiles without FMT_STRING
godbolt repro:
https://godbolt.org/z/h7Trrjf5M
Metadata
Metadata
Assignees
Labels
No labels