diff options
author | devashish <devashishjaiswal86@gmail.com> | 2020-11-29 14:16:37 +0530 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-29 16:22:04 +0100 |
commit | 0b252c31b2a4f699f9f2f219d7bd6495833982ba (patch) | |
tree | 6fabacf0849def19b777676e76d701b98c3bdfb7 /AK | |
parent | d4b2e8987501102f0e6f9a6b5790aa1dae609cb7 (diff) | |
download | serenity-0b252c31b2a4f699f9f2f219d7bd6495833982ba.zip |
AK: Add missing GenericTraits<u8>
This enables us to use keys of type u8 in HashMaps.
Diffstat (limited to 'AK')
-rw-r--r-- | AK/Traits.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/AK/Traits.h b/AK/Traits.h index 9d04f1d367..e3b7c1ac66 100644 --- a/AK/Traits.h +++ b/AK/Traits.h @@ -55,6 +55,12 @@ struct Traits<unsigned> : public GenericTraits<unsigned> { }; template<> +struct Traits<u8> : public GenericTraits<u8> { + static constexpr bool is_trivial() { return true; } + static unsigned hash(u8 u) { return int_hash(u); } +}; + +template<> struct Traits<u16> : public GenericTraits<u16> { static constexpr bool is_trivial() { return true; } static unsigned hash(u16 u) { return int_hash(u); } |