diff --git a/include/fmt/core.h b/include/fmt/core.h index de6164fe..029d941b 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1146,9 +1146,6 @@ constexpr bool is_arithmetic_type(type t) { struct unformattable {}; struct unformattable_char : unformattable {}; struct unformattable_const : unformattable {}; -struct unformattable_function_pointer : unformattable {}; -struct unformattable_member_function_pointer : unformattable {}; -struct unformattable_member_object_pointer : unformattable {}; struct unformattable_pointer : unformattable {}; template struct string_value { @@ -1231,9 +1228,6 @@ template class value { value(unformattable_char); value(unformattable_const); value(unformattable_pointer); - value(unformattable_function_pointer); - value(unformattable_member_function_pointer); - value(unformattable_member_object_pointer); private: // Formats an argument of a custom type, such as a user-defined class. @@ -1375,20 +1369,20 @@ template struct arg_mapper { } template >::type>::value)> - FMT_CONSTEXPR auto map(const T&) -> unformattable_function_pointer { + FMT_ENABLE_IF( + std::is_function::type>::value)> + FMT_CONSTEXPR auto map(const T&) -> unformattable_pointer { return {}; } template ::value)> - FMT_CONSTEXPR auto map(const T&) -> unformattable_member_object_pointer { + FMT_CONSTEXPR auto map(const T&) -> unformattable_pointer { return {}; } template ::value)> - FMT_CONSTEXPR auto map(const T&) -> unformattable_member_function_pointer { + FMT_CONSTEXPR auto map(const T&) -> unformattable_pointer { return {}; } @@ -1397,10 +1391,10 @@ template struct arg_mapper { template < typename T, - FMT_ENABLE_IF(!std::is_function>::type>::value && - std::is_convertible::value && - !std::is_convertible::value)> + FMT_ENABLE_IF( + !std::is_function::type>::value && + std::is_convertible::value && + !std::is_convertible::value)> FMT_CONSTEXPR auto map(const T&) -> unformattable_pointer { return {}; } @@ -1704,27 +1698,6 @@ FMT_CONSTEXPR FMT_INLINE auto make_arg(T&& val) -> value { static_assert(formattable_pointer, "Formatting of non-void pointers is disallowed."); - // Formatting of function pointers is disallowed. - constexpr bool formattable_function_pointer = - !std::is_same::value; - static_assert(formattable_function_pointer, - "Formatting of function pointers is disallowed."); - - // Formatting of member function pointers is disallowed. - constexpr bool formattable_member_function_pointer = - !std::is_same::value; - static_assert(formattable_member_function_pointer, - "Formatting of member function pointers is disallowed."); - - // Formatting of member object pointers is disallowed. - constexpr bool formattable_member_object_pointer = - !std::is_same::value; - static_assert(formattable_member_object_pointer, - "Formatting of member object pointers is disallowed."); - constexpr bool formattable = !std::is_same::value; static_assert(