mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-01 14:41:43 +01:00
Namespace qualify calls to get
This commit is contained in:
@@ -59,6 +59,23 @@ TEST(compile_test, compile_fallback) {
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), 42));
|
||||
}
|
||||
|
||||
struct type_with_get {
|
||||
template <int> friend void get(type_with_get);
|
||||
};
|
||||
|
||||
FMT_BEGIN_NAMESPACE
|
||||
template <> struct formatter<type_with_get> : formatter<int> {
|
||||
template <typename FormatContext>
|
||||
auto format(type_with_get, FormatContext& ctx) -> decltype(ctx.out()) {
|
||||
return formatter<int>::format(42, ctx);
|
||||
}
|
||||
};
|
||||
FMT_END_NAMESPACE
|
||||
|
||||
TEST(compile_test, compile_type_with_get) {
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), type_with_get()));
|
||||
}
|
||||
|
||||
#ifdef __cpp_if_constexpr
|
||||
struct test_formattable {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user