mirror of
https://github.com/fmtlib/fmt.git
synced 2026-05-03 19:30:47 +02:00
Make ostream operators opt in to reduce the risk of ODR violations
This commit is contained in:
@@ -1016,7 +1016,11 @@ struct fallback_formatter {
|
||||
// Specifies if T has an enabled fallback_formatter specialization.
|
||||
template <typename T, typename Char>
|
||||
using has_fallback_formatter =
|
||||
#ifdef FMT_DEPRECATED_OSTREAM
|
||||
std::is_constructible<fallback_formatter<T, Char>>;
|
||||
#else
|
||||
std::false_type;
|
||||
#endif
|
||||
|
||||
struct view {};
|
||||
|
||||
|
||||
@@ -105,6 +105,9 @@ struct fallback_formatter<T, Char, enable_if_t<is_streamable<T, Char>::value>>
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
template <typename T, typename Char = char>
|
||||
using ostream_formatter = detail::fallback_formatter<T, Char>;
|
||||
|
||||
FMT_MODULE_EXPORT
|
||||
template <typename Char>
|
||||
void vprint(std::basic_ostream<Char>& os, basic_string_view<Char> format_str,
|
||||
|
||||
Reference in New Issue
Block a user