mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-09 12:50:05 +00:00
arg_mapper -> type_mapper
This commit is contained in:
parent
e97df46ae1
commit
8a19b2db77
@ -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 <typename Char> struct arg_mapper {
|
||||
template <typename Char> 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 <typename Char> struct arg_mapper {
|
||||
|
||||
// detail:: is used to workaround a bug in MSVC 2017.
|
||||
template <typename T, typename Char>
|
||||
using mapped_t = decltype(detail::arg_mapper<Char>::map(std::declval<T&>()));
|
||||
using mapped_t = decltype(detail::type_mapper<Char>::map(std::declval<T&>()));
|
||||
|
||||
// A type constant after applying arg_mapper.
|
||||
// A type constant after applying type_mapper.
|
||||
template <typename T, typename Char = char>
|
||||
using mapped_type_constant = type_constant<mapped_t<T, Char>, Char>;
|
||||
|
||||
|
@ -3602,18 +3602,6 @@ auto write(OutputIt out, const T* value, const format_specs& specs = {},
|
||||
return write_ptr<Char>(out, bit_cast<uintptr_t>(value), &specs);
|
||||
}
|
||||
|
||||
// A write overload that handles implicit conversions.
|
||||
template <typename Char, typename OutputIt, typename T,
|
||||
typename Context = basic_format_context<OutputIt, Char>>
|
||||
FMT_CONSTEXPR auto write(OutputIt out, const T& value) -> enable_if_t<
|
||||
std::is_class<T>::value && !has_to_string_view<T>::value &&
|
||||
!is_floating_point<T>::value && !std::is_same<T, Char>::value &&
|
||||
!std::is_same<
|
||||
T, remove_cvref_t<decltype(arg_mapper<Char>::map(value))>>::value,
|
||||
OutputIt> {
|
||||
return write<Char>(out, arg_mapper<Char>::map(value));
|
||||
}
|
||||
|
||||
template <typename Char, typename OutputIt, typename T,
|
||||
FMT_ENABLE_IF(mapped_type_constant<T, Char>::value ==
|
||||
type::custom_type &&
|
||||
|
@ -351,7 +351,7 @@ template <typename T, typename Char> struct is_range {
|
||||
namespace detail {
|
||||
|
||||
template <typename Context> struct range_mapper {
|
||||
using mapper = arg_mapper<typename Context::char_type>;
|
||||
using mapper = type_mapper<typename Context::char_type>;
|
||||
using char_type = typename Context::char_type;
|
||||
|
||||
template <typename T,
|
||||
|
Loading…
Reference in New Issue
Block a user