mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Workaround a bug in MSVC
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
This commit is contained in:
parent
9beddd08f9
commit
6c6b1fbf6e
@ -419,6 +419,15 @@ 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>;
|
||||||
|
|
||||||
|
// Workaround a bug in MSVC 2015 and earlier.
|
||||||
|
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910
|
||||||
|
template <typename R, typename Char>
|
||||||
|
struct is_formattable_delayed
|
||||||
|
: disjunction<
|
||||||
|
is_formattable<uncvref_type<maybe_const_range<R>>, Char>,
|
||||||
|
has_fallback_formatter<uncvref_type<maybe_const_range<R>>, Char>> {};
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
template <typename T, typename Char, typename Enable = void>
|
template <typename T, typename Char, typename Enable = void>
|
||||||
@ -582,19 +591,14 @@ struct range_format_kind
|
|||||||
template <typename R, typename Char>
|
template <typename R, typename Char>
|
||||||
struct formatter<
|
struct formatter<
|
||||||
R, Char,
|
R, Char,
|
||||||
enable_if_t<conjunction<
|
enable_if_t<conjunction<bool_constant<range_format_kind<R, Char>::value !=
|
||||||
bool_constant<range_format_kind<R, Char>::value !=
|
range_format::disabled>
|
||||||
range_format::disabled>
|
// Workaround a bug in MSVC 2015 and earlier.
|
||||||
// Workaround a bug in MSVC 2017 and earlier.
|
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1910
|
||||||
#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1920
|
,
|
||||||
,
|
detail::is_formattable_delayed<R, Char>
|
||||||
disjunction<
|
|
||||||
is_formattable<detail::uncvref_type<detail::maybe_const_range<R>>,
|
|
||||||
Char>,
|
|
||||||
detail::has_fallback_formatter<
|
|
||||||
detail::uncvref_type<detail::maybe_const_range<R>>, Char>>
|
|
||||||
#endif
|
#endif
|
||||||
>::value>>
|
>::value>>
|
||||||
: detail::range_default_formatter<range_format_kind<R, Char>::value, R,
|
: detail::range_default_formatter<range_format_kind<R, Char>::value, R,
|
||||||
Char> {
|
Char> {
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user