diff options
author | David P. Sicilia <dpacbach@users.noreply.github.com> | 2019-11-14 10:08:24 -0500 |
---|---|---|
committer | Victor Zverovich <victor.zverovich@gmail.com> | 2019-11-14 07:08:24 -0800 |
commit | 2145a7bdccdda0b39d96a99f943123317145b874 (patch) | |
tree | 4ef6befe615773f75e1da376612024fdcee189f3 /test | |
parent | 52ae134f8441a34b57e30159dd5a6eee2e84b596 (diff) | |
download | fmtlib-2145a7bdccdda0b39d96a99f943123317145b874.tar.gz |
Move has_formatter into the public fmt namespace. (#1407)
* Move has_formatter into the public fmt namespace.
This will allow users to do SFINAE-friendly checks for
the formattability of a type.
Fixes #1369
Diffstat (limited to 'test')
-rw-r--r-- | test/core-test.cc | 8 | ||||
-rw-r--r-- | test/format-test.cc | 4 |
2 files changed, 6 insertions, 6 deletions
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<enabled_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<enabled_formatter, context>::value)); - EXPECT_FALSE((has_formatter<disabled_formatter, context>::value)); - EXPECT_FALSE((has_formatter<disabled_formatter_convertible, context>::value)); + static_assert(has_formatter<enabled_formatter, context>::value, ""); + static_assert(!has_formatter<disabled_formatter, context>::value, ""); + static_assert(!has_formatter<disabled_formatter_convertible, context>::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::formatter<TestEnum>, - fmt::format_context>::value)); + static_assert(!fmt::has_formatter<fmt::formatter<TestEnum>, + fmt::format_context>::value, ""); } #if FMT_HAS_FEATURE(cxx_strong_enums) |