diff --git a/include/fmt/core.h b/include/fmt/core.h index 6cca7645..84ba653e 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1209,7 +1209,7 @@ template class value { } value(unformattable); value(unformattable_char); - value(unformattable_const) {} + value(unformattable_const); value(unformattable_pointer); private: @@ -1634,6 +1634,14 @@ template value { const auto& arg = arg_mapper().map(std::forward(val)); + constexpr bool formattable_char = + !std::is_same::value; + static_assert(formattable_char, "Mixing character types is disallowed."); + + constexpr bool formattable_const = + !std::is_same::value; + static_assert(formattable_const, "Cannot format a const argument."); + // Formatting of arbitrary pointers is disallowed. If you want to output // a pointer cast it to "void *" or "const void *". In particular, this // forbids formatting of "[const] volatile char *" which is printed as bool @@ -1643,14 +1651,6 @@ FMT_CONSTEXPR FMT_INLINE auto make_arg(T&& val) -> value { static_assert(formattable_pointer, "Formatting of non-void pointers is disallowed."); - constexpr bool formattable_char = - !std::is_same::value; - static_assert(formattable_char, "Mixing character types is disallowed."); - - constexpr bool formattable_const = - !std::is_same::value; - static_assert(formattable_const, "Cannot format a const argument."); - constexpr bool formattable = !std::is_same::value; static_assert(