diff --git a/include/fmt/base.h b/include/fmt/base.h index 2a50e11c..50600334 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1092,7 +1092,7 @@ struct use_format_as< template > struct use_formatter : bool_constant<(std::is_class::value || std::is_enum::value || - std::is_union::value) && + std::is_union::value || std::is_array::value) && !has_to_string_view::value && !is_named_arg::value && !use_format_as::value> {}; @@ -1100,6 +1100,7 @@ template > auto has_formatter_impl(T* p, buffered_context* ctx = nullptr) -> decltype(formatter().format(*p, *ctx), std::true_type()); template auto has_formatter_impl(...) -> std::false_type; + // T can be const-qualified to check if it is const-formattable. template constexpr auto has_formatter() -> bool { return decltype(has_formatter_impl(static_cast(nullptr)))::value; @@ -1152,9 +1153,6 @@ template struct type_mapper { std::is_member_pointer::value)> static auto map(const T&) -> void; - template ::value)> - static auto map(const T (&)[N]) -> const T (&)[N]; - template ::value)> static auto map(const T& x) -> decltype(map(format_as(x))); @@ -2152,9 +2150,6 @@ template class value { "formatting of non-void pointers is disallowed"); } - template ::value)> - FMT_CONSTEXPR value(const T (&x)[N]) : value(x, custom_tag()) {} - template ::value)> value(const T& x) : value(format_as(x)) {}