Add member format_as for std

This commit is contained in:
Victor Zverovich
2024-09-20 07:08:47 -07:00
parent 6d43c755bc
commit a197a994c5
4 changed files with 38 additions and 19 deletions
+2
View File
@@ -2030,6 +2030,8 @@ enum big_enum : unsigned long long { big_enum_value = 5000000000ULL };
auto format_as(big_enum e) -> unsigned long long { return e; }
TEST(format_test, strong_enum) {
auto arg = fmt::basic_format_arg<fmt::context>(big_enum_value);
EXPECT_EQ(arg.type(), fmt::detail::type::ulong_long_type);
EXPECT_EQ(fmt::format("{}", big_enum_value), "5000000000");
}
#endif