From 52c536bb8d90cf0f09e13f5e9e21bf489cc08c23 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 10 Feb 2022 16:39:40 +0800 Subject: [PATCH] hb-algs.hh: Fix build on Visual Studio 2015 The compiler does not recognize the std::hash call on hb_decay, so give it a shove so that it is recognized there. --- src/hb-algs.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 3a3ab0804..550b8a41a 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -226,8 +226,14 @@ struct template constexpr auto 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 constexpr auto impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, std::hash>{} (hb_deref (v))) +#else + template constexpr auto + impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, std::hash>{} (hb_deref (v))) +#endif template ::value)> constexpr auto