diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 2cab2dcd1..f0947282d 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -225,19 +225,17 @@ struct hb_is_iterable /* hb_is_iterator() / hb_is_random_access_iterator() / hb_is_sorted_iterator() */ -template -struct _hb_is_iterator_of -{ - char operator () (...) { return 0; } - template int operator () (hb_iter_t *) { return 0; } - template int operator () (hb_iter_t *) { return 0; } - template int operator () (hb_iter_t *) { return 0; } - template int operator () (hb_iter_t *) { return 0; } - static_assert (sizeof (char) != sizeof (int), ""); -}; +template +static inline char _hb_is_iterator_of (hb_priority<0>, const void *) { return 0; } +template +static inline int _hb_is_iterator_of (hb_priority<2>, hb_iter_t *) { return 0; } + template struct hb_is_iterator_of { enum { - value = sizeof (int) == sizeof (hb_declval (_hb_is_iterator_of) (hb_declval (Iter*))) }; }; + value = sizeof (int) == sizeof (_hb_is_iterator_of (hb_prioritize, hb_declval (Iter*))) }; }; #define hb_is_iterator_of(Iter, Item) hb_is_iterator_of::value #define hb_is_iterator(Iter) hb_is_iterator_of (Iter, typename Iter::item_t)