1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:27:34 +00:00

AK: Define our own concept of "trivially serializable"

While at it, rename the `read_trivial_value` and `write_trivial_value`
functions to `read_value` and `write_value` respectively, since we'll
add compatibility for non-trivial types down the line.
This commit is contained in:
Tim Schumacher 2023-01-14 21:13:29 +01:00 committed by Tim Flynn
parent 6777cb0975
commit d1711f1cef
5 changed files with 23 additions and 14 deletions

View file

@ -97,3 +97,8 @@ private:
static_assert(sizeof(PacketHeader) == 12);
}
template<>
struct AK::Traits<DNS::PacketHeader> : public AK::GenericTraits<DNS::PacketHeader> {
static constexpr bool is_trivially_serializable() { return true; }
};