AK: Add missing GenericTraits<u8>
This enables us to use keys of type u8 in HashMaps.
This commit is contained in:
parent
d4b2e89875
commit
0b252c31b2
Notes:
sideshowbarker
2024-07-19 01:12:18 +09:00
Author: https://github.com/devsh0 Commit: https://github.com/SerenityOS/serenity/commit/0b252c31b2a Pull-request: https://github.com/SerenityOS/serenity/pull/4237 Issue: https://github.com/SerenityOS/serenity/issues/4212 Issue: https://github.com/SerenityOS/serenity/issues/4215
1 changed files with 6 additions and 0 deletions
|
@ -54,6 +54,12 @@ struct Traits<unsigned> : public GenericTraits<unsigned> {
|
|||
static unsigned hash(unsigned u) { return int_hash(u); }
|
||||
};
|
||||
|
||||
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; }
|
||||
|
|
Loading…
Add table
Reference in a new issue