AK: Define is_trivially_serializable trait for Little and BigEndian<>

This will allow us get LittleEndian<> and BigEndian<> wrapped types
directly from Stream::read_value<>().
This commit is contained in:
Karol Kosek 2023-01-21 15:45:23 +01:00 committed by Andreas Kling
parent c39d3c30b7
commit 2d976ab2a6
Notes: sideshowbarker 2024-07-17 01:23:17 +09:00

View file

@ -151,6 +151,16 @@ template<typename T>
requires(HasFormatter<T>) struct Formatter<BigEndian<T>> : Formatter<T> {
};
template<typename T>
struct Traits<LittleEndian<T>> : public GenericTraits<LittleEndian<T>> {
static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); }
};
template<typename T>
struct Traits<BigEndian<T>> : public GenericTraits<BigEndian<T>> {
static constexpr bool is_trivially_serializable() { return Traits<T>::is_trivially_serializable(); }
};
}
#if USING_AK_GLOBALLY