fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
19.9k stars 2.43k forks source link

Enable inheriting from formatter<std::string_view> #4055

Closed Arghnews closed 1 day ago

Arghnews commented 1 week ago

Fixes #4036

This formatter specialization with base::format means a class implicitly convertible to std::string_view will now be converted by this format function before being passed to the fmt::string_view format function. This wouldn't work previously as the compiler may only perform one implicit conversion, and we need 2 here (from our type, to std::string_view, to fmt::string_view).

vitaut commented 1 day ago

Merged, thanks!