Add fmt::enums::format_as

This commit is contained in:
Victor Zverovich
2022-02-19 08:03:42 -08:00
parent 1319719a5e
commit aad44f2839
2 changed files with 13 additions and 0 deletions
+6
View File
@@ -1459,8 +1459,14 @@ TEST(format_test, write_uintptr_fallback) {
enum class color { red, green, blue };
namespace test_ns {
enum class color { red, green, blue };
using fmt::enums::format_as;
} // namespace test_ns
TEST(format_test, format_enum_class) {
EXPECT_EQ(fmt::format("{}", fmt::underlying(color::red)), "0");
EXPECT_EQ(fmt::format("{}", test_ns::color::red), "0");
}
TEST(format_test, format_string) {