32 [[nodiscard]]
constexpr T
byteswap(T value)
noexcept
34 static_assert(std::has_unique_object_representations_v<T>,
"T may not have padding bits");
35 auto value_representation = std::bit_cast<std::array<std::byte,
sizeof(T)>>(value);
36 std::ranges::reverse(value_representation);
37 return std::bit_cast<T>(value_representation);