Check if formatter is not defined if there is format_as

This commit is contained in:
Victor Zverovich 2022-03-26 09:36:06 -07:00
parent db5b8993ac
commit e2408f37c8

View File

@ -1440,6 +1440,7 @@ template <typename Context> struct arg_mapper {
FMT_ENABLE_IF(std::is_enum<T>::value&& std::is_integral<U>::value)>
FMT_CONSTEXPR FMT_INLINE auto map(const T& val)
-> decltype(std::declval<arg_mapper>().map(U())) {
static_assert(!has_formatter<T, Context>::value, "");
return map(format_as(val));
}