diff --git a/include/fmt/base.h b/include/fmt/base.h index 6dedd4ec..b08d8267 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1505,12 +1505,14 @@ template struct arg_mapper { return {}; } + // is_fundamental is used to allow formatters for extended FP types. template , - FMT_ENABLE_IF((std::is_class::value || std::is_enum::value || - std::is_union::value) && - !has_to_string_view::value && !is_char::value && - !is_named_arg::value && - !std::is_arithmetic>::value)> + FMT_ENABLE_IF( + (std::is_class::value || std::is_enum::value || + std::is_union::value || std::is_fundamental::value) && + !has_to_string_view::value && !is_char::value && + !is_named_arg::value && !std::is_integral::value && + !std::is_arithmetic>::value)> FMT_MAP_API auto map(T& val) -> decltype(FMT_DECLTYPE_THIS do_map(val)) { return do_map(val); } diff --git a/include/fmt/format.h b/include/fmt/format.h index c68bf2fb..4b0babe8 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3716,7 +3716,9 @@ FMT_CONSTEXPR auto write(OutputIt out, const T& value) -> enable_if_t< template > FMT_CONSTEXPR auto write(OutputIt out, const T& value) - -> enable_if_t::value == type::custom_type, + -> enable_if_t::value == + type::custom_type && + !std::is_fundamental::value, OutputIt> { auto formatter = typename Context::template formatter_type(); auto parse_ctx = typename Context::parse_context_type({});