Fix std::byte formatting with compile-time API (#2072)

* add test for byte formatting with `FMT_COMPILE`

* fix byte formatting with `FMT_COMPILE`, use `__cpp_lib_byte` macro

* use is not custom mapped type check

* workaround MSVC bug
This commit is contained in:
Alexey Ochapov
2020-12-27 18:23:28 +03:00
committed by GitHub
parent bbd6ed5bc5
commit d09b5c1453
3 changed files with 13 additions and 5 deletions

View File

@@ -130,6 +130,9 @@ TEST(CompileTest, FormatDefault) {
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), "foo"));
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), std::string("foo")));
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), test_formattable()));
# ifdef __cpp_lib_byte
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), std::byte{42}));
# endif
}
TEST(CompileTest, FormatWideString) {