- Rename is_not_recursive_range to is_nonrecursive_range and add comment that explains it being depending on is_range being true
- Merge has_fallback_formatter_delayed into is_formattable_delayed and add comment that explains it being depending on is_not_recursive_range being true - Replace disjunction in formatter specialization by has_fallback_formatter_delayed - Get rid of unneeded detail:: prefixes within namespace detail
This commit is contained in:
parent
bfff7ed4b7
commit
c03288b0a7
@ -391,19 +391,21 @@ template <typename R>
|
|||||||
using maybe_const_range =
|
using maybe_const_range =
|
||||||
conditional_t<has_const_begin_end<R>::value, const R, R>;
|
conditional_t<has_const_begin_end<R>::value, const R, R>;
|
||||||
|
|
||||||
|
// is_nonrecursive_range depends on fmt::is_range<T, Char>::value == true.
|
||||||
|
// It exists to ensure short-circuit evaluation in the constraint of the
|
||||||
|
// formatter specialization below. A similar approach is used in
|
||||||
|
// https://wg21.link/p2286.
|
||||||
template <typename R>
|
template <typename R>
|
||||||
struct is_not_recursive_range : bool_constant<
|
struct is_nonrecursive_range : bool_constant<
|
||||||
!std::is_same<detail::uncvref_type<R>, R>::value> {};
|
!std::is_same<uncvref_type<R>, R>::value> {};
|
||||||
|
|
||||||
|
// is_formattable_delayed depends on is_nonrecursive_range<R>::value == true.
|
||||||
|
// It exists to ensure short-circuit evaluation in the constraint of the
|
||||||
|
// formatter specialization below.
|
||||||
template <typename R, typename Char>
|
template <typename R, typename Char>
|
||||||
struct is_formattable_delayed : is_formattable<
|
struct is_formattable_delayed : disjunction<
|
||||||
detail::uncvref_type<detail::maybe_const_range<R>>, Char> {
|
is_formattable<uncvref_type<maybe_const_range<R>>, Char>,
|
||||||
};
|
has_fallback_formatter<uncvref_type<maybe_const_range<R>>, Char>> {};
|
||||||
|
|
||||||
template <typename R, typename Char>
|
|
||||||
struct has_fallback_formatter_delayed : detail::has_fallback_formatter<
|
|
||||||
detail::uncvref_type<detail::maybe_const_range<R>>, Char> {
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
@ -412,14 +414,11 @@ struct formatter<
|
|||||||
R, Char,
|
R, Char,
|
||||||
enable_if_t<
|
enable_if_t<
|
||||||
conjunction<fmt::is_range<R, Char>,
|
conjunction<fmt::is_range<R, Char>,
|
||||||
detail::is_not_recursive_range<R>
|
detail::is_nonrecursive_range<R>
|
||||||
// Workaround a bug in MSVC 2015 and earlier.
|
// Workaround a bug in MSVC 2015 and earlier.
|
||||||
#if !FMT_MSC_VERSION || FMT_MSC_VERSION > 1900
|
#if !FMT_MSC_VERSION || FMT_MSC_VERSION > 1900
|
||||||
,
|
,
|
||||||
disjunction<
|
detail::is_formattable_delayed<R, Char>
|
||||||
detail::is_formattable_delayed<R, Char>,
|
|
||||||
detail::has_fallback_formatter_delayed<R, Char>
|
|
||||||
>
|
|
||||||
#endif
|
#endif
|
||||||
>::value
|
>::value
|
||||||
>> {
|
>> {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user