Closed AnthonyVH closed 1 month ago
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.
Fix: #4103
I was just about to prepare a PR, but you beat me to it :smile:. Thanks a lot for the super quick fix!
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).