87 requires TriviallyCopyable<U> && (
sizeof(U) > 0)
89 if constexpr (
sizeof(U) == 1) {
92 return std::byteswap(val);
94 auto bytes = std::bit_cast<std::array<std::byte,
sizeof(U)>>(val);
95 for (std::size_t i = 0, j =
sizeof(U); i < j; ++i) {
97 const std::byte tmp = bytes[i];
101 return std::bit_cast<U>(bytes);
Integral type (bool, char, int, long, …), including cv.
Definition categories.hxx:185
constexpr U swap_endian(U val) noexcept
Reverses the object-representation byte order of val.
Definition detail.hxx:88
Root namespace of the StormByte suite.
Octet count. Defined in byte_size.hxx. Forwarded so Type::Numeral can name it.