mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-27 21:00:01 +01:00
Disable fallback_formatter for arrays
This commit is contained in:
@@ -70,8 +70,7 @@ void_t<> operator<<(std::basic_ostream<char, Traits>&, signed char);
|
||||
template <typename Traits>
|
||||
void_t<> operator<<(std::basic_ostream<char, Traits>&, unsigned char);
|
||||
|
||||
// Checks if T has a user-defined operator<< (e.g. not a member of
|
||||
// std::ostream).
|
||||
// Checks if T has a user-defined operator<< e.g. not a member of std::ostream.
|
||||
template <typename T, typename Char> class is_streamable {
|
||||
private:
|
||||
template <typename U>
|
||||
@@ -90,6 +89,11 @@ template <typename T, typename Char> class is_streamable {
|
||||
static const bool value = result::value;
|
||||
};
|
||||
|
||||
// Formatting of arrays is intentionally disabled to prevent conflicts with
|
||||
// standard (non-ostream) formatters.
|
||||
template <typename T, size_t N, typename Char>
|
||||
struct is_streamable<T[N], Char> : std::false_type {};
|
||||
|
||||
// Write the content of buf to os.
|
||||
template <typename Char>
|
||||
void write_buffer(std::basic_ostream<Char>& os, buffer<Char>& buf) {
|
||||
|
||||
Reference in New Issue
Block a user