Correct way to initialize a container of std::byte

Viewed 6089

What is the correct way of initializing a container with predetermined std::byte values?

std::array<std::byte, 2> arr{0x36, 0xd0} for array results in

Enum std::byte has not constant to represent the integer value of X

and compiler errors. Vector and initializer lists are a no-go too.

Is std::vector with std::copy and casts really the intended way of handling this?

1 Answers
Related