diff --git a/include/fmt/core.h b/include/fmt/core.h index 179adab1..aad37683 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -8,8 +8,8 @@ #ifndef FMT_CORE_H_ #define FMT_CORE_H_ -#include // std::byte -#include // std::FILE +#include // std::byte +#include // std::FILE #include #include #include @@ -1364,20 +1364,21 @@ template struct arg_mapper { -> basic_string_view { return std_string_view(val); } - FMT_CONSTEXPR FMT_INLINE auto map(const signed char* val) - -> decltype(this->map("")) { + + using cstring_result = conditional_t::value, + const char*, unformattable_pointer>; + + FMT_CONSTEXPR FMT_INLINE auto map(const signed char* val) -> cstring_result { return map(reinterpret_cast(val)); } FMT_CONSTEXPR FMT_INLINE auto map(const unsigned char* val) - -> decltype(this->map("")) { + -> cstring_result { return map(reinterpret_cast(val)); } - FMT_CONSTEXPR FMT_INLINE auto map(signed char* val) - -> decltype(this->map("")) { + FMT_CONSTEXPR FMT_INLINE auto map(signed char* val) -> cstring_result { return map(reinterpret_cast(val)); } - FMT_CONSTEXPR FMT_INLINE auto map(unsigned char* val) - -> decltype(this->map("")) { + FMT_CONSTEXPR FMT_INLINE auto map(unsigned char* val) -> cstring_result { return map(reinterpret_cast(val)); } @@ -1410,9 +1411,8 @@ template struct arg_mapper { template ::value && - (std::is_convertible::value - || std::is_same::value - ) && + (std::is_convertible::value || + std::is_same::value) && !has_formatter::value && !has_fallback_formatter::value)> FMT_CONSTEXPR FMT_INLINE auto map(const T& val)