hb-algs.hh: Fix build on Visual Studio 2015

The compiler does not recognize the std::hash call on
hb_decay<decltype (hb_deref (v)>, so give it a shove so that it is recognized
there.
This commit is contained in:
Chun-wei Fan 2022-02-10 16:39:40 +08:00 committed by Behdad Esfahbod
parent 81754a5a96
commit 52c536bb8d
1 changed files with 6 additions and 0 deletions

View File

@ -226,8 +226,14 @@ struct
template <typename T> constexpr auto template <typename T> constexpr auto
impl (const T& v, hb_priority<2>) 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 ())
/* Sadly, we must give further hints to VS2015 to build the following template item */
#if !defined (_MSC_VER) || defined (__clang__) || (_MSC_VER >= 1910)
template <typename T> constexpr auto template <typename T> constexpr auto
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v))) impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v)))
#else
template <typename T> constexpr auto
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v).hash ())>>{} (hb_deref (v)))
#endif
template <typename T, template <typename T,
hb_enable_if (std::is_integral<T>::value)> constexpr auto hb_enable_if (std::is_integral<T>::value)> constexpr auto