You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compilation failure when converting decimal to string with {fmt} and FMT_COMPILE #1537
After the commits of PR #1536, the following fails to compile on VS2026 18.11.2:
void DecimalToString(decimal64_t x, wchar_t *s, size_t size)
{
if (s != nullptr && size > 0)
{
auto r = fmt::format_to_n(s, size - 1, FMT_COMPILE(L"{}"), x);
*r.out = L'\0';
}
}
Error C2679 binary '=': no operator found which takes a right-hand operand of type 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' (or there is no acceptable conversion) D:\x\Include\boost\decimal\detail\format_render.hpp 246
Removing FMT_COMPILE works. So does std::format_to_n().
Activity
mborland commentedon Oct 28, 2026
Good question. Let me take a look today and get back to you.
GeoffreyAA commentedon Oct 28, 2026
Thank you.
GeoffreyAA commentedon Oct 29, 2026
@mborland,
Working like a charm. Many thanks.