| 14 | |
| 15 | template<std::integral T> |
| 16 | constexpr T byteswap(T value) noexcept |
| 17 | { |
| 18 | static_assert(std::has_unique_object_representations_v<T>, |
| 19 | "T may not have padding bits"); |
| 20 | auto value_representation = std::bit_cast<std::array<std::byte, sizeof(T)>>(value); |
| 21 | std::ranges::reverse(value_representation); |
| 22 | return std::bit_cast<T>(value_representation); |
| 23 | } |
| 24 | |
| 25 | ModuleMetadataView* ModuleMetadataView::fromBuffer(std::span<uint8_t> moduleData) { |
| 26 | assert(moduleData.size() >= sizeof(ModuleMetadataView)); |
nothing calls this directly
no outgoing calls
no test coverage detected