Move disable-FILE-sfinae to color.h

This commit is contained in:
Nicolas Lesser 2018-12-09 16:23:34 +01:00
parent a690029d9c
commit f7f0b0e995
No known key found for this signature in database
GPG Key ID: 55F9BC675F85A2DF
2 changed files with 9 additions and 5 deletions

View File

@ -423,6 +423,15 @@ template <>
inline void reset_color<wchar_t>(FILE *stream) FMT_NOEXCEPT {
fputs(internal::data::WRESET_COLOR, stream);
}
// The following specialiazation disables using std::FILE as a character type,
// which is needed because or else
// fmt::print(stderr, fmt::emphasis::bold, "");
// would take stderr (a std::FILE *) as the format string.
template <>
struct is_string<std::FILE *> : std::false_type {};
template <>
struct is_string<const std::FILE *> : std::false_type {};
} // namespace internal
template <

View File

@ -508,11 +508,6 @@ namespace internal {
struct dummy_string_view { typedef void char_type; };
dummy_string_view to_string_view(...);
// The following overload disables using std::FILE as a character type, which is
// needed because or else
// fmt::print(stderr, fmt::emphasis::bold, "");
// would take stderr as the format string.
dummy_string_view to_string_view(const std::FILE *);
using fmt::v5::to_string_view;
// Specifies whether S is a string type convertible to fmt::basic_string_view.