Fix handling of types with custom formatters that are convertible to std::string_view

This commit is contained in:
Deniz Evrenci
2019-12-05 13:12:46 +09:00
committed by Victor Zverovich
parent 4f4d876616
commit 1ab80aa92c
2 changed files with 25 additions and 1 deletions

View File

@@ -878,7 +878,9 @@ template <typename Context> struct arg_mapper {
FMT_ENABLE_IF(
std::is_constructible<std_string_view<char_type>, T>::value &&
!std::is_constructible<basic_string_view<char_type>, T>::value &&
!is_string<T>::value)>
!is_string<T>::value &&
!has_formatter<T, Context>::value &&
!has_fallback_formatter<T, Context>::value)>
FMT_CONSTEXPR basic_string_view<char_type> map(const T& val) {
return std_string_view<char_type>(val);
}