From 596508a9282c85ea1817a342577fcbf4b4abd7b1 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 26 Aug 2021 20:56:28 -0700 Subject: [PATCH] Cleanup --- include/fmt/core.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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(