Convenient literal for std::byte
Functions | |
PW_CONSTEVAL std::byte | pw::operator""_b (unsigned long long value) |
PW_CONSTEVAL std::byte pw::operator""_b | ( | unsigned long long | value | ) |
Returns a std::byte
when used as a _b
suffix.
This is useful for writing byte literals, particularly in tests. To use, add using ::pw::operator""_b;
and then use like 5_b
in order to create a std::byte
with the contents 5
.
This should not be used in header files, as it requires a using
declaration that will be publicly exported at whatever level it is used.