mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +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
Notes:
sideshowbarker
2024-07-17 01:23:17 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/2d976ab2a6 Pull-request: https://github.com/SerenityOS/serenity/pull/17118 Reviewed-by: https://github.com/nico Reviewed-by: https://github.com/timschumi ✅
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> {
|
||||
};
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue