diff --git a/include/fmt/std.h b/include/fmt/std.h index be1cc56d..0370f781 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -692,15 +692,17 @@ template struct formatter, Char> { } }; +FMT_EXPORT +template +struct formatter, Char, + enable_if_t, Char>::value>> + : formatter, Char> { + template + auto format(std::reference_wrapper ref, FormatContext& ctx) const + -> decltype(ctx.out()) { + return formatter, Char>::format(ref.get(), ctx); + } +}; + FMT_END_NAMESPACE - -namespace std { - -template -constexpr auto format_as(std::reference_wrapper ref) -> T& { - return ref.get(); -} - -} // namespace std - #endif // FMT_STD_H_