static_assert payload
This commit is contained in:
@@ -161,6 +161,7 @@ TEST_F(FileFixture, Write_ShouldRoundTripArbitraryData)
|
|||||||
|
|
||||||
bool operator==(const Payload&) const = default;
|
bool operator==(const Payload&) const = default;
|
||||||
};
|
};
|
||||||
|
static_assert(std::is_trivially_copyable_v<Payload>);
|
||||||
|
|
||||||
constexpr Payload payload {.m_intValue = 42, .m_doubleValue = 3.14, .m_tag = {'B', 'I', 'G', 'F'}};
|
constexpr Payload payload {.m_intValue = 42, .m_doubleValue = 3.14, .m_tag = {'B', 'I', 'G', 'F'}};
|
||||||
m_writeScratchFile.Write({std::bit_cast<const std::byte*>(&payload), sizeof(payload)}, 0);
|
m_writeScratchFile.Write({std::bit_cast<const std::byte*>(&payload), sizeof(payload)}, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user