From 8a19b2db779cba178a96eb99da787d9451fc2a51 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 15 Sep 2024 17:09:49 -0700 Subject: [PATCH] arg_mapper -> type_mapper --- include/fmt/base.h | 8 ++++---- include/fmt/format.h | 12 ------------ include/fmt/ranges.h | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 606f4f6b..d2cceb47 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1125,9 +1125,9 @@ constexpr auto has_const_formatter() -> bool { struct unformattable {}; -// Maps formatting argument types to a smaller set. Returns unformattable* on +// Maps formatting argument types to a smaller set. Returns unformattable on // errors to be SFINAE-friendly. -template struct arg_mapper { +template struct type_mapper { static auto map(signed char) -> int; static auto map(unsigned char) -> unsigned; static auto map(short) -> int; @@ -1197,9 +1197,9 @@ template struct arg_mapper { // detail:: is used to workaround a bug in MSVC 2017. template -using mapped_t = decltype(detail::arg_mapper::map(std::declval())); +using mapped_t = decltype(detail::type_mapper::map(std::declval())); -// A type constant after applying arg_mapper. +// A type constant after applying type_mapper. template using mapped_type_constant = type_constant, Char>; diff --git a/include/fmt/format.h b/include/fmt/format.h index 25968f26..e7b0dcd1 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3602,18 +3602,6 @@ auto write(OutputIt out, const T* value, const format_specs& specs = {}, return write_ptr(out, bit_cast(value), &specs); } -// A write overload that handles implicit conversions. -template > -FMT_CONSTEXPR auto write(OutputIt out, const T& value) -> enable_if_t< - std::is_class::value && !has_to_string_view::value && - !is_floating_point::value && !std::is_same::value && - !std::is_same< - T, remove_cvref_t::map(value))>>::value, - OutputIt> { - return write(out, arg_mapper::map(value)); -} - template ::value == type::custom_type && diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 6175fc8b..c9f69d50 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -351,7 +351,7 @@ template struct is_range { namespace detail { template struct range_mapper { - using mapper = arg_mapper; + using mapper = type_mapper; using char_type = typename Context::char_type; template