Make std::byte formattabe (#1981)

This commit is contained in:
Victor Zverovich
2020-12-03 08:50:28 -08:00
parent 683a74501f
commit 4a6eadbde0
2 changed files with 11 additions and 1 deletions

View File

@@ -1762,6 +1762,13 @@ TEST(FormatTest, JoinArg) {
#endif
}
#if __cplusplus >= 201703L
TEST(FormatTest, JoinBytes) {
std::vector<std::byte> v = {std::byte(1), std::byte(2), std::byte(3)};
EXPECT_EQ("1, 2, 3", fmt::format("{}", fmt::join(v, ", ")));
}
#endif
template <typename T> std::string str(const T& value) {
return fmt::format("{}", value);
}