Since std::byte
is by definition not an integral type, the following fragment is ill-formed:
enum class foo : std::byte
{
bar = 1,
baz = 2
};
Is there a way in C++17 to do something equivalent to this?
Edit: I'm not trying to solve any particular problem. Obviously enum class whatever : unsigned char
would do it. However, I was expecting std::byte
to be a little more flexible and wanted to know whether this is possible at all.