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
This commit is contained in:
committed by
Victor Zverovich
parent
52ae134f84
commit
2145a7bdcc
+4
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user