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);
|
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.
|
// Specifies whether to format enums.
|
||||||
template <typename T, typename Enable = void>
|
template <typename T, typename Enable = void>
|
||||||
struct format_enum : std::integral_constant<bool, std::is_enum<T>::value> {};
|
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.
|
// Formatter of objects of type T.
|
||||||
template <typename T, typename Char>
|
template <typename T, typename Char>
|
||||||
struct formatter<T, Char,
|
struct formatter<T, Char, typename std::enable_if<internal::format_type<T>::value>::type> {
|
||||||
typename std::enable_if<internal::gettype<T>() != internal::CUSTOM>::type> {
|
|
||||||
|
|
||||||
// Parses format specifiers stopping either at the end of the range or at the
|
// Parses format specifiers stopping either at the end of the range or at the
|
||||||
// terminating '}'.
|
// terminating '}'.
|
||||||
|
@ -87,8 +87,7 @@ struct format_enum<T,
|
|||||||
// Formats an object of type T that has an overloaded ostream operator<<.
|
// Formats an object of type T that has an overloaded ostream operator<<.
|
||||||
template <typename T, typename Char>
|
template <typename T, typename Char>
|
||||||
struct formatter<T, Char,
|
struct formatter<T, Char,
|
||||||
typename std::enable_if<
|
typename std::enable_if<!internal::format_type<T>::value>::type>
|
||||||
internal::gettype<T>() == internal::CUSTOM>::type>
|
|
||||||
: formatter<basic_string_view<Char>, Char> {
|
: formatter<basic_string_view<Char>, Char> {
|
||||||
|
|
||||||
void format(basic_buffer<Char> &buf, const T &value,
|
void format(basic_buffer<Char> &buf, const T &value,
|
||||||
|
Loading…
Reference in New Issue
Block a user