mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-26 12:19:45 +01:00
fix: support optional<T> with format_as(T) (#3713)
Formatting a std::optional<T> where T had a custom format_as(T) function failed to compile with clang, due to set_debug_format being hidden by private inheritance. This fix makes the function available through a using clause.
This commit is contained in:
@@ -4054,6 +4054,7 @@ struct formatter<T, Char, enable_if_t<detail::has_format_as<T>::value>>
|
||||
: private formatter<detail::format_as_t<T>, Char> {
|
||||
using base = formatter<detail::format_as_t<T>, Char>;
|
||||
using base::parse;
|
||||
using base::set_debug_format;
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const T& value, FormatContext& ctx) const -> decltype(ctx.out()) {
|
||||
|
||||
Reference in New Issue
Block a user