diff --git a/include/fmt/core.h b/include/fmt/core.h index 091da657..7e6de98f 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -542,14 +542,14 @@ struct FMT_DEPRECATED convert_to_int : bool_constant::value && std::is_convertible::value> {}; -namespace internal { - // Specifies if T has an enabled formatter specialization. A type can be // formattable even if it doesn't have a formatter e.g. via a conversion. template using has_formatter = std::is_constructible>; +namespace internal { + /** A contiguous memory buffer with an optional growing ability. */ template class buffer { private: diff --git a/test/core-test.cc b/test/core-test.cc index acfd2cd0..c3706002 100644 --- a/test/core-test.cc +++ b/test/core-test.cc @@ -453,11 +453,11 @@ template <> struct formatter { FMT_END_NAMESPACE TEST(CoreTest, HasFormatter) { - using fmt::internal::has_formatter; + using fmt::has_formatter; using context = fmt::format_context; - EXPECT_TRUE((has_formatter::value)); - EXPECT_FALSE((has_formatter::value)); - EXPECT_FALSE((has_formatter::value)); + static_assert(has_formatter::value, ""); + static_assert(!has_formatter::value, ""); + static_assert(!has_formatter::value, ""); } struct convertible_to_int { diff --git a/test/format-test.cc b/test/format-test.cc index 61b893c4..0dce6bad 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1974,8 +1974,8 @@ enum TestEnum { A }; TEST(FormatTest, Enum) { EXPECT_EQ("0", fmt::format("{}", A)); } TEST(FormatTest, FormatterNotSpecialized) { - EXPECT_FALSE((fmt::internal::has_formatter, - fmt::format_context>::value)); + static_assert(!fmt::has_formatter, + fmt::format_context>::value, ""); } #if FMT_HAS_FEATURE(cxx_strong_enums)