mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
[hash] Add hash impl for integers
Part of https://github.com/harfbuzz/harfbuzz/issues/4227
This commit is contained in:
parent
b7a8d23bc8
commit
0e02680803
1 changed files with 5 additions and 1 deletions
|
@ -236,7 +236,11 @@ struct
|
|||
private:
|
||||
|
||||
template <typename T> constexpr auto
|
||||
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, hb_deref (v).hash ())
|
||||
impl (const T& v, hb_priority<2>) const HB_RETURN (uint32_t, hb_deref (v).hash ())
|
||||
|
||||
// Horrible: std:hash() of integers seems to be identity in gcc / clang?!
|
||||
template <typename T> constexpr auto
|
||||
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 2654435761u)
|
||||
|
||||
template <typename T> constexpr auto
|
||||
impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v)))
|
||||
|
|
Loading…
Add table
Reference in a new issue