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
Before f6b4a23b83 the function formatted_size() in compile.h was marked as FMT_CONSTEXPR20.
This allowed writing compile-time formatting using C++23's static constexpr members inside a constexpr function. E.g.:
template <fmt::detail::udl_compiled_string format, auto... values>
constexpr std::string_view constexpr_format() {
staticconstexprauto str = [] {
constexprauto result_length = fmt::formatted_size(format, values...);
auto result = std::array<char, result_length>{};
fmt::format_to(result.data(), format, values...);
return result;
}();
returnstd::string_view(str.data(), str.size());
}
However, since the linked commit, this annotation was removed. Looking at the commit, I can't figure out why this is the case. Is there any chance of re-introducing the constexpr on all functions that allow it in compile.h?
PS: fmt::counting_buffer::count() is not marked constexpr either. When I wrote the snippet above, an fmt::counting_iterator was used instead in fmt::formatted_size() (but this iterator was removed in ba36a0481).
The text was updated successfully, but these errors were encountered:
It was relying on deprecated and inefficient counting_iterator which was removed. A PR to constexprify counting_buffer and reintroduce constexpr to formatted_size would be welcome.
Before f6b4a23b83 the function
formatted_size()
incompile.h
was marked asFMT_CONSTEXPR20
.This allowed writing compile-time formatting using C++23's
static constexpr
members inside a constexpr function. E.g.:However, since the linked commit, this annotation was removed. Looking at the commit, I can't figure out why this is the case. Is there any chance of re-introducing the
constexpr
on all functions that allow it incompile.h
?PS:
fmt::counting_buffer::count()
is not markedconstexpr
either. When I wrote the snippet above, anfmt::counting_iterator
was used instead infmt::formatted_size()
(but this iterator was removed in ba36a0481).The text was updated successfully, but these errors were encountered: