Workaround a bug in MSVC
This commit is contained in:
parent
5e0562ab51
commit
70ef82a8e3
@ -3575,6 +3575,12 @@ const Char *do_format_arg(basic_buffer<Char> &buffer,
|
||||
return pointer_from(it);
|
||||
}
|
||||
|
||||
// Specifies whether to format T using the standard formatter.
|
||||
// It is not possible to use gettype in formatter specialization directly
|
||||
// because of a bug in MSVC.
|
||||
template <typename T>
|
||||
struct format_type : std::integral_constant<bool, gettype<T>() != CUSTOM> {};
|
||||
|
||||
// Specifies whether to format enums.
|
||||
template <typename T, typename Enable = void>
|
||||
struct format_enum : std::integral_constant<bool, std::is_enum<T>::value> {};
|
||||
@ -3582,8 +3588,7 @@ struct format_enum : std::integral_constant<bool, std::is_enum<T>::value> {};
|
||||
|
||||
// Formatter of objects of type T.
|
||||
template <typename T, typename Char>
|
||||
struct formatter<T, Char,
|
||||
typename std::enable_if<internal::gettype<T>() != internal::CUSTOM>::type> {
|
||||
struct formatter<T, Char, typename std::enable_if<internal::format_type<T>::value>::type> {
|
||||
|
||||
// Parses format specifiers stopping either at the end of the range or at the
|
||||
// terminating '}'.
|
||||
|
@ -87,8 +87,7 @@ struct format_enum<T,
|
||||
// Formats an object of type T that has an overloaded ostream operator<<.
|
||||
template <typename T, typename Char>
|
||||
struct formatter<T, Char,
|
||||
typename std::enable_if<
|
||||
internal::gettype<T>() == internal::CUSTOM>::type>
|
||||
typename std::enable_if<!internal::format_type<T>::value>::type>
|
||||
: formatter<basic_string_view<Char>, Char> {
|
||||
|
||||
void format(basic_buffer<Char> &buf, const T &value,
|
||||
|
Loading…
Reference in New Issue
Block a user