Closed WBurzynski closed 5 months ago
@WBurzynski, thanks for reporting! This seems to be related to #503. Initially, the fmtlib did not require the format()
member function to be const
, and this was how they implemented their own formatters. However, during the standardization process, this member function became const
, and fmtlib updated the support in the next releases. mp-units stayed behind.
I actually started to work on this issue during the weekend, and hopefully, it will be fixed soon.
Some time ago there was this issue in fmt: https://github.com/fmtlib/fmt/issues/2754 where const qualifiers were added to some functions. I suspect that either somewhere in fmt another const
is missing or in auto format(const quantity& q, FormatContext& ctx)
const quantity
is too restrictive.
No, the problem is that the member function format()
should be const
qualified, but it isn't. It was changed while fmt was standardized.
Not sure if It's this library bug or fmt, but trying to print vector of quantity results in compile time error.
Problem reproduced in compiler explorer:
https://godbolt.org/z/7v5jjh9Gs
Problematic code: