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
A workaround for now is to use fmt's truncating iterator with fmt::format_to:
static const auto formatter = FMT_COMPILE("{}");
std::array<char, 512> s2{0};
// These two lines should be equivalent
// auto it = fmt::format_to_n(s0.data(), 512, formatter, 42).out; // fails at compile time
auto it = fmt::format_to(fmt::detail::truncating_iterator<char*>(s2.data(), s2.size()), formatter, 42).base();
std::cout << s2.data() << std::endl;
Example code: https://godbolt.org/z/erD-_a
In v6
fmt::format_to_n()
seems to work withfmt::compile()
-d format string.In v7 though, just
fmt::format_to()
is working withFMT_COMPILE()
.The text was updated successfully, but these errors were encountered: