Skip to content

Commit

Permalink
AK: Add missing GenericTraits<u8>
Browse files Browse the repository at this point in the history
This enables us to use keys of type u8 in HashMaps.
  • Loading branch information
devsh0 authored and awesomekling committed Nov 29, 2020
1 parent d4b2e89 commit 0b252c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions AK/Traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit 0b252c3

Please sign in to comment.