mirror of
https://github.com/fmtlib/fmt.git
synced 2025-02-14 09:39:51 +00:00
Initial support for extended FP types
This commit is contained in:
parent
5af88653eb
commit
aecec01b34
@ -1505,12 +1505,14 @@ template <typename Context> struct arg_mapper {
|
||||
return {};
|
||||
}
|
||||
|
||||
// is_fundamental is used to allow formatters for extended FP types.
|
||||
template <typename T, typename U = remove_const_t<T>,
|
||||
FMT_ENABLE_IF((std::is_class<U>::value || std::is_enum<U>::value ||
|
||||
std::is_union<U>::value) &&
|
||||
!has_to_string_view<U>::value && !is_char<U>::value &&
|
||||
!is_named_arg<U>::value &&
|
||||
!std::is_arithmetic<format_as_t<U>>::value)>
|
||||
FMT_ENABLE_IF(
|
||||
(std::is_class<U>::value || std::is_enum<U>::value ||
|
||||
std::is_union<U>::value || std::is_fundamental<U>::value) &&
|
||||
!has_to_string_view<U>::value && !is_char<U>::value &&
|
||||
!is_named_arg<U>::value && !std::is_integral<U>::value &&
|
||||
!std::is_arithmetic<format_as_t<U>>::value)>
|
||||
FMT_MAP_API auto map(T& val) -> decltype(FMT_DECLTYPE_THIS do_map(val)) {
|
||||
return do_map(val);
|
||||
}
|
||||
|
@ -3716,7 +3716,9 @@ FMT_CONSTEXPR auto write(OutputIt out, const T& value) -> enable_if_t<
|
||||
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<mapped_type_constant<T, Context>::value == type::custom_type,
|
||||
-> enable_if_t<mapped_type_constant<T, Context>::value ==
|
||||
type::custom_type &&
|
||||
!std::is_fundamental<T>::value,
|
||||
OutputIt> {
|
||||
auto formatter = typename Context::template formatter_type<T>();
|
||||
auto parse_ctx = typename Context::parse_context_type({});
|
||||
|
Loading…
x
Reference in New Issue
Block a user