std::byte v[3] = {std::byte(10), std::byte(20), std::byte(30)};
EXPECT_EQ(fmt::format(L"({})", fmt::join(v, v + 3, L", ")), L"(10, 20, 30)");
EXPECT_EQ(fmt::format(L"({:02X})", fmt::join(v, v + 3, L", ")), L"(0A, 14, 1E)");
fails to compile at the 3rd line since 11.1.
namespace std {
template <typename T, FMT_ENABLE_IF(std::is_same<T, std::byte>::value)>
inline auto format_as(T b) -> unsigned char {
return static_cast<unsigned char>(b);
}
} // namespace std
back instead of the member format_as thing seems to fix it.