diff --git a/src/hb-iter.hh b/src/hb-iter.hh index a4ffbd6f0..46d6c406b 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -209,13 +209,16 @@ template struct hb_is_iterable { private: + template - static auto test (int) -> decltype (hb_declval (U).iter (), hb_true_t ()); + static auto impl (hb_priority<1>) -> decltype (hb_declval (U).iter (), hb_true_t ()); + template - static hb_false_t test (...); + static hb_false_t impl (hb_priority<0>); public: - enum { value = decltype (test (0))::value }; + + enum { value = decltype (impl (hb_prioritize))::value }; }; #define hb_is_iterable(Iterable) hb_is_iterable::value