Try fixing byte regression

This commit is contained in:
Victor Zverovich
2021-12-18 08:51:21 -08:00
parent e46392ea2c
commit 2d44577586

View File

@ -1415,17 +1415,20 @@ template <typename Context> struct arg_mapper {
} }
template <typename T, template <typename T,
FMT_ENABLE_IF(std::is_enum<T>::value && FMT_ENABLE_IF(
(std::is_convertible<T, int>::value || std::is_enum<T>::value&& std::is_convertible<T, int>::value &&
std::is_same<T, detail::byte>::value) && !has_formatter<T, Context>::value &&
!has_formatter<T, Context>::value && !has_fallback_formatter<T, char_type>::value)>
!has_fallback_formatter<T, char_type>::value)>
FMT_CONSTEXPR FMT_INLINE auto map(const T& val) FMT_CONSTEXPR FMT_INLINE auto map(const T& val)
-> decltype(std::declval<arg_mapper>().map( -> decltype(std::declval<arg_mapper>().map(
static_cast<typename std::underlying_type<T>::type>(val))) { static_cast<typename std::underlying_type<T>::type>(val))) {
return map(static_cast<typename std::underlying_type<T>::type>(val)); return map(static_cast<typename std::underlying_type<T>::type>(val));
} }
FMT_CONSTEXPR FMT_INLINE auto map(detail::byte val) -> unsigned char {
return map(static_cast<unsigned char>(val));
}
template <typename T, typename U = remove_cvref_t<T>> template <typename T, typename U = remove_cvref_t<T>>
struct formattable struct formattable
: bool_constant<has_const_formatter<U, Context>() || : bool_constant<has_const_formatter<U, Context>() ||