mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
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:
parent
c39d3c30b7
commit
2d976ab2a6
1 changed files with 10 additions and 0 deletions
10
AK/Endian.h
10
AK/Endian.h
|
@ -151,6 +151,16 @@ template<typename T>
|
||||||
requires(HasFormatter<T>) struct Formatter<BigEndian<T>> : Formatter<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
|
#if USING_AK_GLOBALLY
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue